I need a skill that reacts to stacks in an opponent

I'm making a game with characters wich principal difference is the attribute, every character has skill sets that can learn when they level up. My actual character is the Lightning one, and I want three skills:

1: Thunder Mark: Sets a Thunder Mark in the enemy, every thunder mark reduces the 5% of the AGI. The thunder marks vanishes after five turns.

2: Thunder Strike: Deals thunder damage equal to the user atk to an opponent. The skill is repeated for every Thunder Mark.

3: Thunderstruck: Deals thunder damage equal to the user atk multiply for "(1 + Thunder Marks) * 2". It vanishes all the thunder marks.

Original thread: https://forums.rpgmakerweb.com/threads/i-need-a-skill-that-reacts-to-stacks-in-an-opponent.145279/