Button Mashing Help

Hey everyone so I'm using RPG Maker VX Ace and I'd like to know how to add a button-mashing mini game.
My character is basically climbing up a tree and you have to button mash for a certain amount of time to keep him going up. When that time is done you'll have to switch to another button to keep him moving or he'll slide down.
Could someone help me out? I'm afraid I don't know the first thing about button mashing
So basically a OnButtonCommonEvent script (I'm not sure these exist for VX), where you increase a variable with one when you push a certain button, while a parallel process runs that decreases the same variable by one, and then waits x frames, before checking if the variable is higher than a certain number. If it is, flip a self-switch on the Parrallel event, switching it to an autorun event that says "You climbed the tree", then flips another self switch to become a new parrallel event that does the same as the climbing, just with a different Variable to keep the dude in the tree.
Are you using Ace or VX? Because you're talking about Ace in your post but posted in VX. I'm fairy certain that I saw a button-mash mini game script by Shanghai, but I'm not sure if that's suitable for your needs.
Other than that, freakytapirs eventing idea seems good to me.

Original thread: https://forums.rpgmakerweb.com/threads/button-mashing-help.133465/