Simple Scene & Window - What am I doing wrong?

I wrote this simple JS script:

/*: * @plugindesc Simple scene that doesn't do . * @author Ryth * @*/(function() {    var _Game_Interpreter_pluginCommand =        Game_Interpreter.prototype.pluginCommand;    Game_Interpreter.prototype.pluginCommand = function (command, args) {        _Game_Interpreter_pluginCommand.call(this, command, args);        if (command === 'SimpleWindow') {            switch (args[0]) {                case 'open':                    SceneManager.push(Scene_Simple);                    break;            }        }    };    function Scene_Simple()    {        this.initialize.apply(this, arguments);    }    Scene_Simple.prototype = Object.create(Scene_Base.prototype);    Scene_Simple.prototype.constructor = Scene_Simple;    Scene_Simple.prototype.initialize = function () {        Scene_Base.prototype.initialize.call(this);    };    Scene_Simple.prototype.create = function () {        Scene_Base.prototype.create.call(this);        var _wind = new Window_Greeting();        this.addWindow(_wind);    };    function Window_Greeting()    {        this.initialize.apply(this, arguments);    }    Window_Greeting.prototype = Object.create(Window_Base.prototype);    Window_Greeting.prototype.constructor = Window_Greeting;    Window_Greeting.prototype.initialize = function () {        var width = Graphics.boxWidth;        var height = Graphics.boxHeight / 2;        Window_Base.prototype.initialize.call(this, 0, 0, width, height);        var padding = 10;        //this.drawText("Swir Ssie", padding, Graphics.boxHeight / 4, Graphics.boxWidth - (2 * padding), 'center');    };})();Can someone point me in the right direction? I don't know what I'm doing wrong here. When I use the plugin command I get an error:

Type Error: Can't get property 'addChild' of undefined.
Windows are drawn on a windowLayer. You have to create the window layer before you add the window, so drop this line in your create function before your addWindow line:

this.createWindowLayer();The addWindow function just adds a window as a child of a windowLayer. Thus your error: windowLayer was undefined.

Also: how did you get the PluginCommand event to recognize your code inside of that self-executing anonymous function? Even with direct script calls to Scene_Simple, I couldn't get MV to access anything inside the code at all until I removed it - which, from my understanding of SEAFs, is exactly what should have happened.

Original thread: https://forums.rpgmakerweb.com/threads/simple-scene-window-what-am-i-doing-wrong.47353/