You can use a (self) switch to track whether the button was pressed or not last frame. Here's an example I copied from one of my scrap projects:
Spoiler
◆Control Variables:#0019 Mash = 30
◆Control Variables:#0020 Time = 300
◆Loop
◆If:Button [OK] is pressed down
◆Wait:1 frame
◆
:Else
◆Break Loop
◆
:End
◆
:Repeat Above
◆Loop
◆If:Button [OK] is pressed down
◆Control Switches:#0020 ButtonDown = ON
◆
:Else
◆If:ButtonDown is ON
◆Control Switches:#0020 ButtonDown = OFF
◆Control Variables:#0019 Mash -= 1
◆
:End
◆
:End
◆If:Mash ≤ 0
◆Comment:Complete!
◆Break Loop
◆
:Else
◆If:Time ≤ 0
◆Comment:Time up!
◆Break Loop
◆
:Else
◆Comment:Continue.
◆Control Variables:#0020 Time -= 1
◆Wait:1 frame
◆
:End
◆
:End
◆
:Repeat Above
The first loop is to make sure the button is unpressed before starting, the second one is for the actual mashing.
Alternatively, as implied, you could use Conditional Branch -> Script:
Input.isTriggered("ok")
This should be true if the "ok" button is pressed this frame but wasn't pressed the previous frame.
Also, in case you haven't seen it, this tutorial may be helpful:
by: @hiddenone Read the Tutorial Here!
forums.rpgmakerweb.com