Script call to jump straight to key items section

Hey folks
I have a custom plugin handling my main menu. I want one of the menu buttons to take the player straight to the "Key Items" section of "Items" when pressed.

This is my function
Code:
Scene_Menu.prototype.commandKeyItems = function () {
    //Change this below to point to key items
    SceneManager.push(Scene_Item);
}

Anyone know what to change the "SceneManager.push(Scene_Item);" part to, to get it to go to key items?
Hi!
Well, if you type in the console while inside the scene_item and with the cursor in the Key Item category:

SceneManager._scene._categoryWindow._index

This will return 3.

So I think what you have to do is when you open your scene with:

JavaScript:
Scene_Menu.prototype.commandKeyItems = function () {
    //Change this below to point to key items
    // create a flag here to the scene item knows when it is called this way, it will start with the categoryWindow_index = 3;
    SceneManager.push(Scene_Item);
}

So when you open Scene_Item and this flag is true, it will start on index 3, instead of 0(Regular items)
The KeyItemAlone.js plugin that comes with RPG Maker MV might be a help to you. I am looking at this as well.
Ok, here's what I have so far. Keep in mind this will always open the key item window and highlight the first key item. Also, there is probably a better way to do some of this, I just wanted to get it in some sort of working condition.

Code:
Scene_Item.prototype.createCategoryWindow = function() {
    this._categoryWindow = new Window_ItemCategory();
    this._categoryWindow.setHelpWindow(this._helpWindow);
    this._categoryWindow.y = this._helpWindow.height;
    this._categoryWindow.setHandler('ok',     this.onCategoryOk.bind(this));
    this._categoryWindow.setHandler('cancel', this.popScene.bind(this));
    // ----- Add this to select the Key Items in the Category window. ----- //
    this._categoryWindow.select(3);
    // ----- End of addition ----- //
    this.addWindow(this._categoryWindow);
};

Scene_Item.prototype.createItemWindow = function () {
        var wy = this._categoryWindow.y + this._categoryWindow.height;
        var wh = Graphics.boxHeight - wy;
        this._itemWindow = new Window_ItemList(0, wy, Graphics.boxWidth, wh);
        this._itemWindow.setHelpWindow(this._helpWindow);
        this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
        this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
        this.addWindow(this._itemWindow);
        this._categoryWindow.setItemWindow(this._itemWindow);

        // ----- Start new code ----- //
        // Select the key items category (like hitting enter)
        this.onCategoryOk();

        // Deactivate the category window so the key items selection stops flashing
        this._categoryWindow.deactivate();

        // Activate the item window so you can interact with it
        this._itemWindow.activate();

        // Update the help window with the description of the first key item
        // Length of all the items the party has (items, weapons, armour, keyitems)
        var len = $gameParty.allItems().length;

        // Select the category for the call to includes() below
        this._itemWindow.setCategory('keyItem');

        // For each item in the party item list
        for (var i = 0; i < len; ++i) {
            // Get the current item
            var item = $gameParty.allItems()[i];

            // If the item is a keyItem
            if (this._itemWindow.includes(item)) {
                // Set the help window to display the item description
                this._helpWindow.setItem(item);
                break;
            }
        }
        // ----- End new code ----- //
    };

This will work in a plugin, but again, it will always do this. Hopefully this can be turned into a plugin command of some sort.
K. I just threw a conditional around the new code using a switch.
In the event, turn the switch on, call SceneManager.push(Scene_Item), then turn the switch off.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-to-jump-straight-to-key-items-section.120558/