[RMMV] Skill screen doesn't close when skill is used in battle

Hey dream team,

I'm currently finalising the last component of my battle system alterations in RMMV.
It currently works like this:

Actor has two types of skills - CHAIN and FINISH. CHAIN skills are the ones I am trying to script for at the moment. I'm using YEP SkillCore & Instant Cast which means the player can use these skills multiple times in a single turn as long as they have enough MP.

When you select CHAIN skill using the Instant Cast plugin, the skill window still closes and returns to the actor command select. What I would like to try to do is have the skill select screen stay open so that more CHAIN skills can be selected in the single turn without having to constantly select the CHAIN command over and over. Instead I would like the player to close the skill select screen with the cancel button once they have used up their MP.

Now look... it is a small inconvenience to the player and this seems like it could be a lot of work for little gain, but it could also help the battle flow and intuitiveness of the system immensely.

Does anyone know where I should start or have some input on how I could achieve this?
you should look into the Scene_Battle windows, I don't know Yanfly and Instant Cast very well but you should create a plugin of yours to mess around with the code. What you are looking for is the command that gets called when you cast the chain skill. When the Scene creates the window it also add "handlers" to the commands of the window, basically it binds effects to the buttons. Example code:

Code:
Scene_Title.prototype.createCommandWindow = function() {
    this._commandWindow = new Window_TitleCommand();
    this._commandWindow.setHandler('newGame',  this.commandNewGame.bind(this));
    this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
    this._commandWindow.setHandler('options',  this.commandOptions.bind(this));
    this.addWindow(this._commandWindow);
};

here for example this._commandWindow.setHandler('newGame', this.commandNewGame.bind(this)) basically sets the newGame button to execute Scene_Title.prototype.commandNewGame.
You can find these commands in rpg_scene or in the plugins you added (plugins often override previous functions.

So either in the plugins you use or in rpg_scenes you have to find the command of when you confirm the use of that skill, it will probably be something like this:
Code:
Scene_Battle.prototype.onEnemyOk = function() {
    var action = BattleManager.inputtingAction();
    action.setTarget(this._enemyWindow.enemyIndex());
    this._enemyWindow.hide();
    this._skillWindow.hide();
    this._itemWindow.hide();
    this.selectNextCommand();
};

as you can see the command closes the windows of that shows the skill (this._skillWindow.hide()) or something like that, you can maybe try to put a few of those closure in an if like "if I'm not using chain skills" or whatever conditions you want .

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-skill-screen-doesnt-close-when-skill-is-used-in-battle.119678/