Is there a way to make a button mash to escape minigame?

It's pretty much what's said in the title, something like beam struggle in dragon ball games, is that possible?
There have been a fair number of threads on that topic, here's some search results~
Here's a thread with various suggestions on how to make a button-mash minigame:
And here's a tutorial on a possible QTE ("quick time event") structure:
(This one doesn't describe a button-mash event, but the input-loop structure it describes can be used for many different kinds of minigame.)

For stuff on the map, 2 common approaches are:
  1. Use Loop & Break Loop commands, with Wait 1 frame as the last command inside the loop, to check for input once per frame (Conditional Branch -> Button) and respond appropriately. A timer can be implemented by counting the frames using a variable in that same loop.

  2. Alternatively, block the player in with invisible, Same as characters, Player Touch (or Action Button) events. When the player activates them, you can do stuff. A timer can be implemented as a separate, Parallel event.
If you want this to happen in battle instead, you're probably best off with a plugin: either something that lets you run common events mid-skill (e.g. "action sequences") or something that implements a custom QTE framework specifically integrated with battle actions.
set a parallel event with a switch trigger:
if button is triggered, add x variable +1
if x variable >= a certain number
something happens

you can add timer in yr QTE
if timer == 0
if x variable >= success number
you win
if x variable < success number
you lose
set a parallel event with a switch trigger:
if button is triggered, add x variable +1
if x variable >= a certain number
something happens

you can add timer in yr QTE
if timer == 0
if x variable >= success number
you win
if x variable < success number
you lose
thank you

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-make-a-button-mash-to-escape-minigame.163742/