How I have to write with this togheter?
You do not need to use past perfect at all, if the sequence of past events is clear. Past perfect is used to clarify that one event in the past transpired before another, i.e. when it is not already evident in the context.
'I had already finished my coffee when the waiter at last brought me my order.'