MZ Skill that gets stronger if used repeatedly?

Hey all, need some help creating a skill. I'm looking to make it increase in strength the more it's used back to back, but have it return to base power if any other action is taken.
I figure I should use a variable that increases every time the move is used that returns to 0 for any other action, but I'm not sure how to go about it for something like that actor using an item.
Any help would be greatly appreciated!
Could have the skill call a common event that increases a variable by whatever number of dmg you wanna add, and add that variable into your damage formula. Have every other skill they can use also call a different common event that just resets said variable.

E.g.
Code:
a.atk + v[x] - b.def
Is this per actor or does anyone taking another action matter? If it's per actor, I think you can put a passive state with VS that checks stuff like below (replace X with skill id). And then use in the skill damage formula (a.skillXPower || 0)

<JS Post-Apply as User>
if (this.isSkill() && this.item().id === X) {
user.skillXPower = user.skillXPower || 0;
user.skillXPower += 1;
} else {
delete user.skillXPower;
}
</JS Post-Apply as User>

Original thread: https://forums.rpgmakerweb.com/threads/skill-that-gets-stronger-if-used-repeatedly.178170/