Adding new variables to Game_Party? (SOLVED)

There are two places that need to be monkey patched so you're halfway there already. We can reduce some code as well.

Spoiler: Source
Code:
// Add the Intel entry to the main menu.

Window_MenuCommand.prototype.addOriginalCommands = (function (original) {
    "use strict";

    function addOriginalCommands() {
        original.call(this);

        this.addCommand("Intel", "intel", true);
    }

    return addOriginalCommands;
}(Window_MenuCommand.prototype.addOriginalCommands));


// Handle when the Intel entry is clicked on the main menu.

Scene_Menu.prototype.createCommandWindow = (function (original) {
    "use strict";

    function createCommandWindow() {
        original.call(this);

        this._commandWindow.setHandler("intel", function () {
            SceneManager.push(Scene_Intel);
        });
    }

    return createCommandWindow;
}(Scene_Menu.prototype.createCommandWindow));
Adding the code in as above doesn't cause the option to appear; I've tried tinkering with it a bit but I've still had no success.
Spoiler: Code block
Code:
//Patch in the handler for the Intel command.
Scene_Menu.prototype.createCommandWindow = (function (original) {
    "use strict";
    function createCommandWindow() {
        original.call(this);

        this._commandWindow.setHandler("intel", function () {
            SceneManager.push(Scene_Intel);
        });
    }

    return createCommandWindow;
}(Scene_Menu.prototype.createCommandWindow));

//Patch the Intel command into the list of commands on the in-game menu.
Window_MenuCommand.prototype.addOriginalCommands = (function (original) {
    "use strict";
    function addOriginalCommands() {
        original.call(this);

        this.addCommand("Intel", "intel", true);
    }

    return addOriginalCommands;
}(Window_MenuCommand.prototype.addOriginalCommands));

//Define initialization, prototype, and constructor for the Intel Scene.
function Scene_Intel() {this.initialize.apply(this, arguments);}
Scene_Intel.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Intel.prototype.constructor = Scene_Intel;
Scene_Intel.prototype.initialize = function() {Scene_MenuBase.prototype.initialize.call(this);};

//Define creation and termination events.
Scene_Intel.prototype.create = function() {
    //Scene_MenuBase.prototype.create.call(this);
    //TODO: Add Help Window.
    //TODO: Add Categories Window.
    this.createIntelWindow();
};

Scene_Intel.prototype.terminate = function() {
    Scene_MenuBase.prototype.terminate.call(this);
};

//Creates the windows that form the Intel menu.
Scene_Intel.prototype.createIntelWindow = function() {
    //this._intelWindow = new Window_IntelList();
    //this._intelWindow.setHandler('cancel', this.popScene.bind(this));
    //this.addWindow(this._intelWindow);
};
As I understand it the code below should create an item in the menu that is enabled but doesn't do anything if you try to activate it - thus everything in the createIntelWindow function being commented out.
Instead the command doesn't show up at all.
This seems a bit more complex than it needs to be. There's a couple of function expressions here.
The first one where you create the command window should create something yes.

The patch part is a complex alias for adding an extra command to the Window_MenuCommands.
Try this instead:
http://prntscr.com/fymliv

Also, addOriginalCommands is not a named function, it's anonymous. I don't think that should cause any issues, but it might.
I copied the latest code block and ran that in a new project changing nothing. The Intel item appears on the main menu. Clicking it causes a black screen which is also what I expect since line 35 (first line of the Scene_Intel.prototype.create method) was commented out.
Spoiler: Here's the code but it's exactly the same.
Code:
//Patch in the handler for the Intel command.
Scene_Menu.prototype.createCommandWindow = (function (original) {
    "use strict";
    function createCommandWindow() {
        original.call(this);

        this._commandWindow.setHandler("intel", function () {
            SceneManager.push(Scene_Intel);
        });
    }

    return createCommandWindow;
}(Scene_Menu.prototype.createCommandWindow));

//Patch the Intel command into the list of commands on the in-game menu.
Window_MenuCommand.prototype.addOriginalCommands = (function (original) {
    "use strict";
    function addOriginalCommands() {
        original.call(this);

        this.addCommand("Intel", "intel", true);
    }

    return addOriginalCommands;
}(Window_MenuCommand.prototype.addOriginalCommands));

//Define initialization, prototype, and constructor for the Intel Scene.
function Scene_Intel() {this.initialize.apply(this, arguments);}
Scene_Intel.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Intel.prototype.constructor = Scene_Intel;
Scene_Intel.prototype.initialize = function() {Scene_MenuBase.prototype.initialize.call(this);};

//Define creation and termination events.
Scene_Intel.prototype.create = function() {
    //Scene_MenuBase.prototype.create.call(this);
    //TODO: Add Help Window.
    //TODO: Add Categories Window.
    this.createIntelWindow();
};

Scene_Intel.prototype.terminate = function() {
    Scene_MenuBase.prototype.terminate.call(this);
};

//Creates the windows that form the Intel menu.
Scene_Intel.prototype.createIntelWindow = function() {
    //this._intelWindow = new Window_IntelList();
    //this._intelWindow.setHandler('cancel', this.popScene.bind(this));
    //this.addWindow(this._intelWindow);
};
I really wonder what might be causing the issue within the plugin.
@Camkitsune What's your setup and do you have any other plugins besides this one?
Narrowing the code down to JUST the items related to adding the menu item (IE stripping out all of the stuff we went over earlier in the thread) causes the item to show up. This means that I've made an error somewhere in the previous code; I'll go through it again to see if I can pinpoint the problem.

Currently this is the only plugin I have loaded.

EDIT:
I've determined that the issue is either with how I'm accessing the DataManager or in how I'm trying to use the loaded data in the plugin command: excerpt for that section of the code is below.
Spoiler: Code Block
Code:
var intelParameters = PluginManager.paramters('IntelSystem');
 
 //Get the intel data from the json file.
DataManager.loadDataFile('$dataIntel', String(intelParameters.JsonFileName));
 
//Define getter for the DataManager.
DataManager.getIntelData = function(id) {
    return this._dataIntel[id];
}; 

//Add the plugin commands.
Game_Interpreter.prototype.pluginCommand = (function (original) {
    "use strict";

    // Define the function that will replace the original.

    function pluginCommand(command, args) {
        original.call(this, command, args);
        //Define intelList if the object doesn't exist already.
        if (!$gameParty.intelList) {
            $gameParty.intelList = new intelList();
        }
      
        if (command == "IntelAdd") { 
            var result = $gameParty.intelList.addIntel(GetIntelData(args));
            //TODO: Add pop-up message giving info.
        } else if (command == "IntelCheck") {
            return $gameParty.intelList.hasIntel(GetIntelData(args));
        } else {
            return;
        }
    }

    return pluginCommand;

    // The line below is where we pass in a reference to the original
    // function for use in the replacement.
}(Game_Interpreter.prototype.pluginCommand));

//Function fetches an intelItem for use by the above commands.
function GetIntelData(args) {
    try {
        var idNum = Number(args[0]);
        var intelFromData = DataManager.getIntelData(idNum);
        var contentIds = args[1].split(" ");
        var contents = [];
        while (contentIds.length > 0) {
            var contentsIndex = Number(contentIds.shift);
            //If contentsIndex is a valid number, AND the number is within the contents array, AND the item hasn't already been added...
            if (!NaN(contentsIndex) && contentsIndex < intelFromData.contents.length    && contents.indexOf(intelFromData.contents[contentsIndex]) === -1) {
                    //...Add the contents item
                    contents.push(intelFromData.contents[contentsIndex]);
                }
        }
    return new IntelItem(idNum, intelFromData.topic, intelFromData.category, contents);
      
    } catch (err) {
        console.log("Intel plugin ran into problems getting the following data:  " + args);
        return null;
    }
}

EDIT 2: Minor note: none of the code involved is currently inside of a closure.
EDIT 3: I was wrong, the real issue was with a missing 'e' in PluginManager.parameters. Stupid mistake.

Original thread: https://forums.rpgmakerweb.com/threads/adding-new-variables-to-game_party-solved.80681/