Custom Escape command - (not) working.

Hi.
I recently added SRD Skill Extender plugin to my project and after organizing spells I noticed I have a spare slot for another command.

I decided I put there "Escape" Command. By default this command is in Party Menu
- Fight
- Escape

And via my plugin I moved it to Actor Window:
- Attack
- Guard
- Item
- Skills

At this point everything is ok. I managed to add command button and this menu looks like I wanted. Wich is:
- Attack
- Guard
- Skills
- Use Item
- Retreat!

... However Command "Retreat!" does not respond at all, maybe except sound "OK" ...
console shows absolutly no error in my code and I completly stuck...

Here is full code so far I managed to make:
Spoiler
Code:
(function() {
   
    function RunForestRun() {
       
        if (this._actor) {   
            $gameParty.performEscape();
            SoundManager.playEscape();
            /*var success = this._preemptive ? true : (Math.random() < this._escapeRatio);*/
            var success = true;
            if (success) {
                this.displayEscapeSuccessMessage();
                this._escaped = true;
                this.processAbort();
            }
            return success;
        }
    };   

    SceneManager.prototype.commandEscape = function() {
        RunForestRun();
    };

   
    Window_ActorCommand.prototype.addEscapeCommand = function() {
        this.addCommand('Retreat', 'RunForestRun', true);
    };
   
    Window_ActorCommand.prototype.addItemCommand = function() {
        this.addCommand('Use Item', 'item', true);
    };   
       
    Window_ActorCommand.prototype.addAttackCommand = function() {
        this.addCommand('Attack!', 'attack', true);
    };

    Window_ActorCommand.prototype.addGuardCommand = function() {
        this.addCommand('Defend', 'guard', true);
    };   
   
    Window_ActorCommand.prototype.makeCommandList = function() {
        if (this._actor) {
           
            this.addAttackCommand();
            this.addGuardCommand();
            this.addItemCommand();
            this.addSkillCommands();
            this.addEscapeCommand();
        }
    };

})();

Any help would be appreciated. Thanks in advance.
-bumb-
From the code you pasted, there does not seem to be a handler set for the symbol 'RunForestRun', so the code doesn't necessarily know what to do when someone clicks the Retreat command. You could try something like the following code to set the handler.

Code:
    BattleManager.runForestRun = function () {
        $gameParty.performEscape();
        SoundManager.playEscape();
        var success = true;
        if (success) {
            this.displayEscapeSuccessMessage();
            this._escaped = true;
            this.processAbort();
        }
        return success;
    };

    var _Scene_Battle_createActorCommandWindow =
        Scene_Battle.prototype.createActorCommandWindow;
    Scene_Battle.prototype.createActorCommandWindow = function () {
        _Scene_Battle_createActorCommandWindow.call(this);
        this._actorCommandWindow.setHandler('RunForestRun', this.commandRetreat.bind(this));
    };

    Scene_Battle.prototype.commandRetreat = function () {
        BattleManager.runForestRun();
    };

I replaced the SceneManager.prototype.commandEscape with Scene_Battle.prototype.commandRetreat. I moved RunForestRun function to the BattleManager so that the 'this' keyword would refer to the right object for the displayEscapeSuccessMessage function. I also got rid of the "if (this._actor)" in the RunForestRun function.
@Yethwhinger - Works like a charm! Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/custom-escape-command-not-working.97468/