Yanfly's CTB - Hide Turn Order Window

Hi,

I need some help hiding the turn order display in some specific circumstances such as on the victory screen and when text is displayed in battle (temporarily hiding). If someone could either point out how to do it, I would be extremely grateful.

Script: http://www.yanfly.moe/wiki/Battle_System_-_CTB_(YEP)

Thanks.
Update: I've solved half of the problem by using the patch here: https://forums.rpgmakerweb.com/inde...attle-result-with-yanfly-plugins-rmmv.104946/ -- It now hides when displaying battle results.

Code:
var Imported = Imported || {};
Imported.MRP_MOG_YEP_BattleResultHide = true;

(function() {
    var MRP_BATTLERESULTHIDE_SB_CREATEBRESULT_OLD = Scene_Battle.prototype.createBResult;
    Scene_Battle.prototype.createBResult = function() {
        MRP_BATTLERESULTHIDE_SB_CREATEBRESULT_OLD.call(this);
        
        if(Imported.YEP_BattleEngineCore) BattleManager._victoryPhase = true;
        if(Imported.YEP_BattleStatusWindow)
        {
            this._statusWindow.hide();       
        }       
    };   
})();

Can anyone use this to also hide the CTB order window when text is being shown in battle?

I read somewhere that is might have to do with $gameMessage.isBusy()... how would I use that?

Thanks.
So the setting "BattleManager._victoryPhase = true;" hides it permanently. I need a way to turn it off and on when text shows in battle.

Code:
Window_CTBIcon.prototype.updateOpacity = function() {
    var rate = this.opacityFadeRate();
    
    if (this._foreverHidden) return this.reduceOpacity();
    if (this.isReduceOpacity()) return this.reduceOpacity();
    if (BattleManager._victoryPhase) {
      this._foreverHidden = true;
      return this.reduceOpacity();
    }
    if (BattleManager._escaped) {
      this._foreverHidden = true;
      return this.reduceOpacity();
    }
    if (this._battler) {
      var index = BattleManager.ctbTurnOrder().reverse().indexOf(this._battler);
      if (index < 0) return this.reduceOpacity();
    }
    this.contentsOpacity += rate;
};

In the plugin settings, there is a parameter to show hide the turn order "Yanfly.Param.CTBTurnOrder" but I think it only checks this at the battle start...

Code:
Sprite_Battler.prototype.createCTBIcon = function() {
    if (!Yanfly.Param.CTBTurnOrder) return;
    this._ctbIcon = new Window_CTBIcon(this);
};

Is there something we can put in the updateOpacity function to hide when "$gameMessage.isBusy()" or whatever the appropriate condition for that is?
Finally figured it out:

Dedicate a switch to turning it on and off and then put a new line here:

Code:
Window_CTBIcon.prototype.updateOpacity = function() {
    var rate = this.opacityFadeRate();
    if ($gameSwitches.value(YOURSWITCH) == false) return this.reduceOpacity();

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-ctb-hide-turn-order-window.115573/