Custom Menu option

From the CommandMenu Scene,

like,


Scene_Menu.prototype.createCommandWindow = function() {
this._commandWindow = new Window_MenuCommand(0, 0);
this._commandWindow.setHandler('item', this.commandItem.bind(this));
this._commandWindow.setHandler('skill', this.commandPersonal.bind(this));
this._commandWindow.setHandler('equip', this.commandPersonal.bind(this));
this._commandWindow.setHandler('status', this.commandPersonal.bind(this));
this._commandWindow.setHandler('formation', this.commandFormation.bind(this));
this._commandWindow.setHandler('options', this.commandOptions.bind(this));
this._commandWindow.setHandler('save', this.commandSave.bind(this));
this._commandWindow.setHandler('gameEnd', this.commandGameEnd.bind(this));
this._commandWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._commandWindow);


This bit here,
Here's my Code


/*:
* @plugindesc This is the Achievements Plug-in!
*
*
* @author TagumonYatsuray
*
* @Param this is Achievements
* @Desc This is the Achievements Parameter
* @Default 0
*
* @help This is the help file!
*
*/

(function() {

var parameters = PluginManager.parameters('Achievements Plugin');

var Parameter = Number(parameters['this is Achievements'] || 0);

var _Scene_Menu_createCustomMenuWindow = Scene_Menu.prototype.createCommandWindow;

Window_MenuCommand.prototype.addOriginalCommands = function() {
this.addCommand("Achievements", 'achievements', true);
};

Scene_Menu.prototype.createCommandWindow = function() {
_Scene_Menu_createCustomMenuWindow.call(this);
this._commandWindow.setHandler('achievements', this.commandAchievements.bind(this));
this.addWindow(this._commandWindow);
};

Scene_Menu.prototype.commandAchievements = function() {
SceneManager.push(Scene_Achievements);
};


//-----------------------------------------------------------------------------
// Window_Achievements_Left
//
// The window for displaying achievements.

function Window_Achievements_Left() {
this.initialize.apply(this, arguments);
}

Window_Achievements_Left.prototype = Object.create(Window_Base.prototype);
Window_Achievements_Left.prototype.constructor = Window_Achievements_Left;

Window_Achievements_Left.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};

Window_Achievements_Left.prototype.windowWidth = function() {
return 200;
};

Window_Achievements_Left.prototype.windowHeight = function() {
return 620;
};

Window_Achievements_Left.prototype.makeCommandList = function() {
this.addAchievementbutton();
};

Window_Achievements_Left.prototype.addAchievementbutton = function() {
this.addCommand("Achievements 1", 'achievements1', true);
};


Window_Achievements_Left.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
};

Window_Achievements_Left.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};

//-----------------------------------------------------------------------------
// Window_Achievements_Top
//
// The window for displaying achievements.

function Window_Achievements_Top() {
this.initialize.apply(this, arguments);
}

Window_Achievements_Top.prototype = Object.create(Window_Base.prototype);
Window_Achievements_Top.prototype.constructor = Window_Achievements_Top;

Window_Achievements_Top.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};

Window_Achievements_Top.prototype.windowWidth = function() {
return 610;
};

Window_Achievements_Top.prototype.windowHeight = function() {
return 90;
};

Window_Achievements_Top.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawTextEx("Achievement 1", 0,0);
};

Window_Achievements_Top.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};

//-----------------------------------------------------------------------------
// Window_Achievements_Bottom
//
// The window for displaying achievements.

function Window_Achievements_Bottom() {
this.initialize.apply(this, arguments);
}

Window_Achievements_Bottom.prototype = Object.create(Window_Base.prototype);
Window_Achievements_Bottom.prototype.constructor = Window_Achievements_Bottom;

Window_Achievements_Bottom.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};

Window_Achievements_Bottom.prototype.windowWidth = function() {
return 610;
};

Window_Achievements_Bottom.prototype.windowHeight = function() {
return 530;
};

Window_Achievements_Bottom.prototype.refresh = function() {
var x = this.textPadding();
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
this.drawTextEx("You got this Achievement by Beating the\nBoss", 0,0);
};

Window_Achievements_Bottom.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};

//-----------------------------------------------------------------------------
// Scene_Achievements
//
// The scene class of the menu screen.

function Scene_Achievements() {
this.initialize.apply(this, arguments);
}

Scene_Achievements.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Achievements.prototype.constructor = Scene_Achievements;

Scene_Achievements.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};

Scene_Achievements.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createAchievementsWindowLeft();
this.createAchievementsWindowTop();
this.createAchievementsWindowBottom();
};


Scene_Achievements.prototype.createAchievementsWindowLeft = function() {
Scene_MenuBase.prototype.create.call(this);
this._achievementsWindowLeft = new Window_Achievements_Left(0,0);
this._achievementsWindowLeft.x = 0;
this._achievementsWindowLeft.y = 0;
this._achievementsWindowLeft.setHandler('achievements1', this.popScene.bind(this));
this.addWindow(this._achievementsWindowLeft);
};

Scene_Achievements.prototype.createAchievementsWindowTop = function() {
this._achievementsWindowTop = new Window_Achievements_Top(0,0);
this._achievementsWindowTop.x = 200;
this._achievementsWindowTop.y = 0;
this.addWindow(this._achievementsWindowTop);
};

Scene_Achievements.prototype.createAchievementsWindowBottom = function() {
this._achievementsWindowBottom = new Window_Achievements_Bottom(0,0);
this._achievementsWindowBottom.x = 200;
this._achievementsWindowBottom.y = 91;
this.addWindow(this._achievementsWindowBottom);
};


Scene_Achievements.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
};

Scene_Achievements.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);

if(Input.isTriggered('cancel')) {
SoundManager.playCancel();
SceneManager.goto(Scene_Menu);
}
}

})();


I added


    Window_MenuCommand.prototype.addAchievementbutton = function() {
        this.addCommand("Achievements 1", 'achievements1', true);
    };


and


this._achievementsWindowLeft.setHandler('achievements',      this.popScene.bind(this));


but it returns me the error: "Undefined is not a function" What about it is Undefined? Are they talking about "setHandler?" or are they talking about 'achievement', or maybe even "popScene"?

Original thread: https://forums.rpgmakerweb.com/threads/custom-menu-option.56215/