So let's take for example Hand of Belimawr. It can stack three times, and lasts for four attacks. If you cast it three times in a row, it will still only last for the next four attacks. But let's say you cast it once, attack three times, cast it again, attack three times, cast it again, then attack three more times. Would you have a single or triple stack with that last attack?
No, despite the lack of graphics, each stack is counted separately. So they will each have their own expiration timer that last 4 attacks. However, crossbow and throwing do not count as attacks, so you can have the 12 bonus fire damage indefinitely.
They aren't shown, but each application has its own timer. In other words, if you cast, attack 3 times, then cast, it will be double for one attack, then single for the next 3.
Assuming you cast it three times, the sceen should display your countdown as 4, 3, 2, 1, 1, 1, Gone. It keeps track of every stack then displays the next lowest stack once the previous stack elapses.