Interrupting a current event with another event by clicking a PictureButton?

I am using Anya and Loo's Button Picture Plugin, works as intended and is simple enough for me to understand.

What I'm trying to do:
is have a clickable picture button using this plugin, that interrupts an ongoing event when clicked on, and instead makes whatever the picture button is connected to run.

The button clicking does make the common event run, but only after the current event is finished. If the player is clicking the button, it just progresses the text of the current event, it doesn't actually activate the button until everything is done. I know in theory- to solve this, there should be a parallel event running to check for inputs, but I cant wrap my head around how to do it. I don't want the current event to stop completely when the parallel event checks to see if something is clicked, because if the picture wasn't clicked, then it needs to keep going as usual.

The player needs to be able to "interrupt" the event that's happening at any point in time during the current event, with the player having the choice to do nothing, and have the event proceed unimpeded. But in every instance of me trying to fix it, it still needs to wait until the current event is done, and I cant figure out what to even check for in the parallel event, because after a certain point, I'd just be rewriting the picture button event myself. How do I do this?
I didn't test it but try removing the message busy conditional in the plugin code (the thing I put a line over):

Sprite_Picture.prototype.isClickEnabled = function() {
var pic = this.picture();
return !!(pic && pic._commonEventId > 0 [S]&& !$gameMessage.isBusy()[/S]);
};

And then I checked the script call list and it says that:
// Anywhere: end the current non-Parallel map event
$gameMap._interpreter.command115();

So try adding to the plugin code that line:

Sprite_Picture.prototype.onClick = function() {
var pic = this.picture();
if (pic && pic._commonEventId > 0) {
$gameMap._interpreter.command115();
// prevent map touch-move + click-through
if ($gameTemp && $gameTemp.clearDestination) $gameTemp.clearDestination();
if (TouchInput && TouchInput.clear) TouchInput.clear();

$gameTemp.reserveCommonEvent(pic._commonEventId);
}
};

EDIT: Seems like the strike-through line didn't appear in the code, but it's that thing between the S and /S in brackets
What exactly commands the event that must be stoped is running? Its a text or something else?
The plugin you are using, has any way to run a script call besides the common event it runs when click a picture?
What exactly commands the event that must be stoped is running? Its a text or something else?
The plugin you are using, has any way to run a script call besides the common event it runs when click a picture?
It's going to be text. I'm basically trying to emulate a visual novel with interactable things you can click on while things are happening, and interrupt them. The plugin, as far as I'm aware, just has the script call to make the picture into a button : "ButtonPicture set pictureId commonEventId" = Picture #1 will trigger Common Event #5 when clicked.
I didn't test it but try removing the message busy conditional in the plugin code (the thing I put a line over):

Sprite_Picture.prototype.isClickEnabled = function() {
var pic = this.picture();
return !!(pic && pic._commonEventId > 0 [S]&& !$gameMessage.isBusy()[/S]);
};

And then I checked the script call list and it says that:
// Anywhere: end the current non-Parallel map event
$gameMap._interpreter.command115();

So try adding to the plugin code that line:

Sprite_Picture.prototype.onClick = function() {
var pic = this.picture();
if (pic && pic._commonEventId > 0) {
$gameMap._interpreter.command115();
// prevent map touch-move + click-through
if ($gameTemp && $gameTemp.clearDestination) $gameTemp.clearDestination();
if (TouchInput && TouchInput.clear) TouchInput.clear();

$gameTemp.reserveCommonEvent(pic._commonEventId);
}
};

EDIT: Seems like the strike-through line didn't appear in the code, but it's that thing between the S and /S in brackets

*Edit -
After re-reading this more, I understood what you meant, I think?

Removing
Code:
&& !$gameMessage.isBusy()
did not break the code, (that was due to a mistake I made) but it still didn't allow for the PictureButton to be clicked while an event was running.

I left the
Code:
&& !$gameMessage.isBusy()
removed, and input
Code:
$gameMap._interpreter.command115();
into the "Sprite_Picture.prototype.onClick = function()" like you showed above. At first it gave an error about something being null, but I tried it again, and the error went away- but now the PictureButton is not clickable at all.

Original thread: https://forums.rpgmakerweb.com/threads/interrupting-a-current-event-with-another-event-by-clicking-a-picturebutton.183139/