Action Count Timer

Hi everyone. I apologise if this question is too vague or not in the right place.

Effectively, what I am trying to do in my game is implement osmething of an in-battle timer; it isn't quite ATB, as the actions still occur on a turn-by-turn basis, but as each action is taken in a battle, a counter decreases, and when the counter reaches 0, the last person to take an action is given the option to take a special turn.

Would I be able to be given some advice as to where to start implementing something like this? I've had plenty of experience with RPG Maker, but in-depth additions like this are still new to me.

Any advice would be appreciated, and apologies if I've asked anything stupid or put it in the wrong place haha

Original thread: https://forums.rpgmakerweb.com/threads/action-count-timer.162009/