Make a Common Event last only while a button is pressed down? (Interference from Yanfly's Button Common Events plugin)

Hi all!
I'm making a Yume Nikki fangame and I need some help with something. This is the first time I've asked for help, I pretty much figured out all my other problems, but this one stumps me.

I have a nuke effect with a countdown and I want the countdown to last ONLY while the OK is button is being held, so the countdown stops when the button is let go and the effect doesn't activate (à la the Eyeball Bomb from Yume 2kki)

I tried a Conditional Branch with "if button OK is pressed", but that triggers the event and it runs automatically whether the button is let go or not, I want it to stop when the button is let go.

Can you guys help me? I suspect some JavaScript code could, but I know nothing about that...

EDIT: I searched around and found the Javascript code "Input.is Repeated()", but it doesn't seem to work. I originally wanted this effect to happen with the shift key, but I'm using Yanlfy's Button Common Event plugin so that might interfere with it. Here's the setup I tried that doesn't work:

Screenshot 2024-07-20 154344.png


EDIT 2: I compiled these script calls, but still nothing happens when I press shift. I suspect Yanfly's Button Common Events plugin is interfering with the script somehow, but I don't know how to correct it.
JavaScript:
while( Input.isRepeated  (16))
{                    
$gamePlayer.requestAnimation(141);
this.wait (196);
$gamePlayer.requestAnimation(140);
$gamePlayer.setTransparent(true);                      
$gamePlayer.reserveTransfer(2, 11, 10,  0, 0);
$gamePlayer.setTransparent(false);
}
I feel like I've nearly solved this issue, I just need to figure out how Yanfly's plugin is interfering and how to correct it...
Well first you need a common event to run parallel to update the count down effect.
Start the event with a button press and stop it when the button is not pressed.
This can be done using a switch.
You can't cancel a wait command like that in your picture.
basically the easiest way is to split up your event into one part that handles the starting sequence and another part that handles the countdown like mentioned above.

and in the countdown parallel you can use the conditional branch if button pressed with the else activated, counting down the variable in the yes branch and aborting the countdown in the else branch (button not pressed)
How would I go about doing this? I implemented something, but still nothing happens when I press shift. I should mention that I've set the whole "effect use" thing like this: Yanfly's Button Common Events plugin activates a the n°12 shiftpressed common event, which turns on the n°6 shift pressed switch, which activates the effectuse common event (which is set to autorun, since the player is not supposed to be able to move during the effect use)

I tried it like this:

Nuke sequence
Screenshot 2024-07-21 054936.png


Countdown event
Screenshot 2024-07-21 054900.png


I'm a complete idiot at complex coding like this, so I try as best as I can...
Maybe you shouldn't use autorun, because it will run in a loop unless you tell it to stop.
Actually, I checked again, I forgot that I changed the setup: shift activates common event 9 (which is set to none as trigger) directly, without that shift pressed switch and event.

Original thread: https://forums.rpgmakerweb.com/threads/make-a-common-event-last-only-while-a-button-is-pressed-down-interference-from-yanflys-button-common-events-plugin.170369/