"Struggle" / Mash to escape mechanic?

Just wanting a sounding board for a way to go about this. I'm using QABS (Action Battle System) so everything I discuss would be in the context of on-map sprite combat (no turn-based combat or battle screen).

In essence, certain events will cause the player to enter a state of "grappling." Mashing keys (ex. the Z key) fast enough in a certain time frame will cause the player to escape the grapple and return to ABS combat. Not being fast enough with the mashing will cause the player to take damage and reset the grapple loop and timer (so if they're too slow at mashing, they'll stay in the grapple forever and just keep taking damage over and over).

My game will not be using an MP/mana bar. So here's what I'm thinking on how to accomplish this behind the scenes.

When the player enters the "grappling" state, movement is disabled and the player is equipped with an invisible piece of equipment that grants them the "escape" skill (bound to the Z key for example). While in this state, all other skills are disabled. The "escape" skill simply regenerates a portion of the mana/MP bar and has no cooldown. Meanwhile, a background skill is also in use during the grappling state which constantly drains your mana/MP bar. Therefore, you need to use the "escape" skill over and over quickly and repeatedly (i.e. mashing the Z button) in order to build up your mana faster than it drains. Then have a conditional trigger to escape the grapple state if the MP bar is filled to a certain amount.

Not sure if it's possible to make a skill that gradually drains mana over time...so maybe just have the background mana-draining skill used over and over again on a loop, costing 1 mana and just have it "drain over time" that way?

A wait timer could then be implemented so that if the player doesn't fill their MP bar to the threshold for escape within an allotted time, they take damage and the entire grappling event resets.

I'd obviously just call the MP bar an escape meter or something and set up some sort of HUD/gauge so that it displays on screen during the grappling state.

Is there a better way to go about this? I feel like nesting so many skill loops could cause performance issues depending on how far this system goes.
I don't use QABS so I'm not fully sure how enemies are setup, but I'm assuming Events are designated as enemies and are controlled some way or another.

In the instance that it is an event based enemy, you could do something like in these pictures. Essentially the event enemy turns into a normal event, and just does stuff based off of how frequently the player can talk to it.

I'm still fairly new to the whole event process, but this might work for your situation, or you can just adapt something similar if it gives you an idea.
I don't use QABS so I'm not fully sure how enemies are setup, but I'm assuming Events are designated as enemies and are controlled some way or another.

In the instance that it is an event based enemy, you could do something like in these pictures. Essentially the event enemy turns into a normal event, and just does stuff based off of how frequently the player can talk to it.

I'm still fairly new to the whole event process, but this might work for your situation, or you can just adapt something similar if it gives you an idea.

Oh man, I didn't even think of counting the amount of times you interact with the event. That's way better than using skill loops! That's actually crazy helpful and I really appreciate you taking the time to put it all there like that.
Glad I could be of help.

Edit: I noticed that in Pictures 2 & 3 I accidentally used Variable #2. Just note that was supposed to be Variable #1 as well. xD

I've moved this thread to MV Support. Thank you.

Moved to: MV Support

Thank you very much, sorry for the trouble.

Original thread: https://forums.rpgmakerweb.com/threads/struggle-mash-to-escape-mechanic.131837/