Change Battle Transition to simple fadeout/in

I'm trying to make a Battle Processing chain where the player wouldn't notice that the game changed it's Troop settings.


The problem is there is a flashing zoom in default transition that I'd like to avoid altogether to make it more smooth.


Any ideas?
You can edit this function. Let me know if you need any help.

Code:
Scene_Map.prototype.updateEncounterEffect = function() {
    if (this._encounterEffectDuration > 0) {
        this._encounterEffectDuration--;
        var speed = this.encounterEffectSpeed();
        var n = speed - this._encounterEffectDuration;
        var p = n / speed;
        var q = ((p - 1) * 20 * p + 5) * p + 1;
        var zoomX = $gamePlayer.screenX();
        var zoomY = $gamePlayer.screenY() - 24;
        if (n === 2) {
            $gameScreen.setZoom(zoomX, zoomY, 1);
            this.snapForBattleBackground();
            this.startFlashForEncounter(speed / 2);
        }
        $gameScreen.setZoom(zoomX, zoomY, q);
        if (n === Math.floor(speed / 6)) {
            this.startFlashForEncounter(speed / 2);
        }
        if (n === Math.floor(speed / 2)) {
            BattleManager.playBattleBgm();
            this.startFadeOut(this.fadeSpeed());
        }
    }
};
Ill try to play with that when I'm home, thanks.

Original thread: https://forums.rpgmakerweb.com/threads/change-battle-transition-to-simple-fadeout-in.66764/