MZ Greying Out/Disabling "Skill Type"

Hi there! My goal today is to disable, or "grey out" the Skill Type command in the Actor Command Window. When you seal a Skill Type, you are still able to enter the list and view the unselectable skills. I want the player to not be able to enter a sealed Skill Type list at all, during battle, in the Actor Command Window. I am trying to edit this line of code in the Window_ActorCommand:

JavaScript:
Window_ActorCommand.prototype.addSkillCommands = function() {
    const skillTypes = this._actor.skillTypes();
    for (const stypeId of skillTypes) {
        const name = $dataSystem.skillTypes[stypeId];
        this.addCommand(name, "skill", !actor.isSkillTypeSealed(stypeId), stypeId);
    }
};

I have edited the final line to include "!actor.isSkillTypeSealed(stypeID)" as a condition. Hoping to figure out why this is not working. I receive no errors, but my sealed Skill Type is still selectable! Am I headed in the right direction? Thank you!
Hi there!
I don't know if this is a typo, but I believe you should use:
!this._actor.isSkillTypeSealed(stypeId)

"this._actor" instead of just "actor"
Hi there!
I don't know if this is a typo, but I believe you should use:
!this._actor.isSkillTypeSealed(stypeId)

"this._actor" instead of just "actor"
Thank you so much for the response! If you don't mind, I'd also like to ask how I would go about making this into a quick plugin, so that I don't have to edit the core script (which I know is bad practice, and which I have been doing!)
You just do it 😛

Paste that function into a text editor, save as a *.js file, include as a plugin.
You just do it 😛

Paste that function into a text editor, save as a *.js file, include as a plugin.
For some reason I thought there was no way it was that straightforward; just created my "first plugin" haha! Thank you both so much! <3

Original thread: https://forums.rpgmakerweb.com/threads/greying-out-disabling-skill-type.163978/