Discrete button presses for button-mashing minigame

I'm trying to make a fairly standard button-mashing minigame: You mash the confirm key to fill up a bar. It mostly works fine. But if you just hold the button down, you automatically win the minigame since it's checking every frame. Is there a way to distinguish between button-pressed and button-held? I tried all the input scripts (isPressed, isTriggered, isRepeated) but they all have the same problem.


My jury-rigged solution was to to set a switch that turns on when the button is pressed and turns off when released, only letting you increment the counter once for each button press. But the computer still sees the input every frame, so holding down the confirm button lags the game incredibly hard (and slows the minigame timer to a crawl).

Original thread: https://forums.rpgmakerweb.com/threads/discrete-button-presses-for-button-mashing-minigame.55398/