Need help to match BGM with Battle Transition

So I'm trying to figure out how inside of rpg_scenes I can match the bgm with my transition edits. To explain further the battle scene instantly transitions with this edit


Scene_Map.prototype.encounterEffectSpeed = function() {



    return 0;


The transition fade in and out doesn't show due to this


Scene_Map.prototype.fadeInForTransfer = function() {
    var fadeType = $gamePlayer.fadeType();
    switch (fadeType) {
    case 0: case 1:
        this.startFadeIn(this.fadeSpeed(), fadeType === 0);
        break;
    }
};


Scene_Map.prototype.fadeOutForTransfer = function() {
    var fadeType = $gamePlayer.fadeType();
    switch (fadeType) {
    case 0: case 1:
        this.startFadeOut(this.fadeSpeed(), fadeType === 0);
        break;
    }
};


I can't figure out how I can make the bgm match as in play instantly along with the battle any edits I make to the bgm lines lead to a prompt "undefined is not a property" screen
First, in practical terms, can you explain what effect you're trying to do? Are you trying to make the bgm start in the middle of the track? What are you trying to accomplish with this?
First, in practical terms, can you explain what effect you're trying to do? Are you trying to make the bgm start in the middle of the track? What are you trying to accomplish with this?

Battle Transition= Instant


Fade IN/Out= Gone


Battle BGM= still plays with a delay as if the battle transition is still there and idk how to edit it.


Goal: have the battle bgm play instantly as well


Example:
So you're trying to get rid of the transition, having a cold cut from field to battle?
So you're trying to get rid of the transition, having a cold cut from field to battle?

Correct which is done, the battle bgm as you may notice still plays with a huge delay so there is a period of just silence and that is what I am trying to figure out how to edit for it to match the instant transition.


Update: I found the solution. In case anyone is interested,


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 === 0) {
            $gameScreen.setZoom(zoomX, zoomY, 1);
            this.snapForBattleBackground();
            this.startFlashForEncounter(speed / 0);
        }
        $gameScreen.setZoom(zoomX, zoomY, q);
        if (n === Math.floor(speed / 6)) {
            this.startFlashForEncounter(speed / 0);
        }
        if (n === Math.floor(speed / 0)) {
            BattleManager.playBattleBgm();
            this.startFadeOut(this.fadeSpeed());
        }
    }
};


Thank you diretooth for assistance.
I didn't do much. Sometimes the key to the solution is explaining what you want to do. It sparks your creativity and gets the brain juices flowing.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-to-match-bgm-with-battle-transition.68021/