We consider a finite buffer system where the buffer content moves in a Markov-additive way while it is strictly between the buffer boundaries. Upon reaching the upper boundary of the buffer the content is not allowed to go higher and for every additional input into the system a penalty must be paid (to negotiate buffer overflow). At the lower boundary (empty buffer) the process terminates. For this system we determine the joint distribution of the total overflow and the last time of being at the upper boundary. The analysis is performed using exursion theory for Markov-additive processes.