MV [Solved] Scene_Battle problems · pausing battle while a Window is active

I'm creating a very simple plugin as a way to learn javascript applied to RMMV, and I've run into a few issues.

My purpose is to show a small "Yes or No" command window during battle after every actor has selected an action, as a way to ask the player for a final confirmation before the skills they selected are executed. I plan on showing them additional info with this window, but for now I just made the commands and nothing else.
I managed to write code that creates and shows the window at the appropiate time, but the problem now is that I don't know how to make the game stop and wait for player input. Right now the window appears but the battle flow continues as usual, and I can select commands in the window but it doesn't accept any input until the actions are over and the input phase begins again.

TL;DR What do I need to do so the game waits for input while a window is on screen?

Here's my current code:
JavaScript:
// New Window · Window_Confirm
function Window_Confirm() {
    this.initialize.apply(this, arguments);
}

Window_Confirm.prototype = Object.create(Window_Command.prototype);
Window_Confirm.prototype.constructor = Window_Confirm;

Window_Confirm.prototype.initialize = function() {
    Window_Command.prototype.initialize.call(this, 0, 0);
    this.x = (Graphics.boxWidth - this.width) / 2;
    this.y = (Graphics.boxHeight - this.height) / 2;
    this.close();
};

Window_Confirm.prototype.makeCommandList = function() {
    this.addCommand("Yes", 'confirmYes');
    this.addCommand("No",  'confirmNo');
};

// Scene_Battle Aliases
var _dawnAliasBattleCreateAllWindows = Scene_Battle.prototype.createAllWindows;
Scene_Battle.prototype.createAllWindows = function() {
    _dawnAliasBattleCreateAllWindows.call(this);
    this.createConfirmWindow();
};

Scene_Battle.prototype.createConfirmWindow = function() {
    this._confirmWindow = new Window_Confirm();
    this._confirmWindow.setHandler('confirmYes',  this.commandConfirmYes.bind(this));
    this._confirmWindow.setHandler('confirmNo', this.commandConfirmNo.bind(this));
    this._confirmWindow.deselect();  
    this._confirmWindow.deactivate();  
    this.addWindow(this._confirmWindow);
}

var _dawnAliasBattleEndCommandSelection = Scene_Battle.prototype.endCommandSelection;
Scene_Battle.prototype.endCommandSelection = function() {
    _dawnAliasBattleEndCommandSelection.call(this);
    this._confirmWindow.activate();
    this._confirmWindow.open();
};

// Scene Battle · New Methods
Scene_Battle.prototype.commandConfirmYes = function () {
    this._confirmWindow.deactivate();
    this._confirmWindow.close();
}

Scene_Battle.prototype.commandConfirmNo = function () {
    this._confirmWindow.deactivate();
    this._confirmWindow.close();
}
Add a check to the battle scene's isAnyInputWindowActive method, e.g.
JavaScript:
var _dawnAliasSceneBattleIsAnyInputWindowActive = Scene_Battle.prototype.isAnyInputWindowActive;
Scene_Battle.prototype.isAnyInputWindowActive = function() {
  return _dawnAliasSceneBattleIsAnyInputWindowActive.apply(this, arguments) ||
    this._confirmWindow.active;
};
Add a check to the battle scene's isAnyInputWindowActive method
Thank you!
This works, though now the window seems to be reappearing at every frame and pausing gameplay, or it's not being hidden at all. Every time I click the commands one action is executed, one at a time (the player moves, does weapon animation, the skill animation appears, etc.)
Thanks anyway, I'll do a few more tests, seems like I'll have to check all the functions again to see what I'm missing.
Just a quick heads up that I managed to get this working the way I wanted it. I now have a firm grasp about how everything works in the programming side of RMMV and although I'm a little frustrated with how some things were designed in the core scripts, giving me headaches to no end trying to figure out why strange things happened, I'm quite happy with the result.

Thanks to everyone who stopped by!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-scene_battle-problems-pausing-battle-while-a-window-is-active.132113/