MV aliasing default methods, undefined variable result.

For my current project I'm removing default battle windows and editing BattleSkills and BattleItems windows, and I've encountered strange and yet simple problem I cannot solve. Take a look at this piece of code:
JavaScript:
    var alias_init = Window_BattleSkill.prototype.initialize;
    Window_BattleSkill.prototype.initialize = function(x, y, width, height){
        alias_init.call(this, x, y, width, height);
        this._battleShow = false;
    };
    
    var alias_show = Window_BattleSkill.prototype.show;
    Window_BattleSkill.prototype.show = function(){
        alias_show.call(this);
        this._battleShow = true;               
    };   
    
    var alias_hide = Window_BattleSkill.prototype.hide;
    Window_BattleSkill.prototype.hide = function(){
        alias_hide.call(this);
        this._battleShow = false;       
    };
    
    Window_BattleSkill.prototype.isVisible = function(){
        return this._battleShow;
    };

As you can see, the sole purpose of this snippet is to add _battleShow variable, which I could use in defining conditions of displaying certain HUD objects in battle, the problem is, method isVisible keeps returning undefined result, but when I open skill list in battle and hide it, value is set to false as should be, but when I open skill list again, and check the result, _battleShow keeps false result, I didn't code anything in JS for 4 months, so I might forget something, and any help or guide would be helpful.
I copy+pasted that code into a new .js file, imported as a plugin, and launched a battle-test with no other plugins active. Checking SceneManager._scene._skillWindow._battleShow via the console always gave me the appropriate true or false value. I think the problem is somewhere else.
@caethyril - that line
SceneManager._scene._skillWindow._battleShow

works the same as in your empty project, actually, this would solve my problem, since I need to check whetter skill window is open or not.
To be clear, SceneManager._scene._skillWindow.isVisible() returns exactly the same results for me.

If you just want a way to check if the skill window is open, you can use the existing isOpen method inherited from Window, or isOpenAndActive from Window_Selectable.

E.g. SceneManager._scene._skillWindow.isOpenAndActive() should be true iff the battle skill window is fully open and accepting user input.
Argh... I knew there would be another way to do it! without adding another, unnecessary method.
Thank you @caethyril. That solves my problem.
Great, happy scripting! 👋

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/aliasing-default-methods-undefined-variable-result.146432/