MZ State that prevents from equipping weapon TYPES

Maybe I'm missing something obvious, but I can only add states that grey out the entire weapon field, whereas I would like a state that prevents from equipping, say, swords and axes.
Is this possible? I'm also using visustella if that helps.
I think it might be easier to go at it from the other direction.

basically you make an automatic state that gives the ability to equip swords and axes, and then create a state that disables that automatic state and gives an immunity against it.
That would work, but I'm adding a small feature to an already big game (with quite a lot of characters), and that wouldn't be convenient to proceed this way. I take it there is no other way then? RM really has the weirdest limits sometimes.
I don't know if VisuStella's stuff can do this already, but something like this may work (untested):
JavaScript:
/*:
 * @target MZ
 * @plugindesc Adds <seal wtype: x, x, x> notetag for trait objects.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/171100/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (alias => {
  const TAG_NAME = "seal wtype";
  Game_BattlerBase.prototype.isEquipWtypeOk = function(wtypeId) {
    return alias.apply(this, arguments) && !this.traitObjects().some(o => {
      const tag = o.meta[TAG_NAME];
      return typeof tag === "string"
          && Array.from(tag.split(","), s => parseInt(s, 10) || 0).includes(wtypeId);
    });
  };
})(Game_BattlerBase.prototype.isEquipWtypeOk);
Then e.g. <seal wtype: 5, 6> to seal weapon types 5 & 6.
there are other ways - the main problem is that that type of effect was not preprogrammed (as you already know the existing seal traits are not for weapon types) and the traits in general are supposed to be permanent and static.

one alternative way is to use a dynamic trait plugin to remove the traits by javascript on the state, and add them again on removing the state.
unfortunately that is more complex if you want to prevent accidentally giving an actor traits he is not supposed to have on removing the state.

there might be an additional way going by conditionals in the equipment setup, but that would require deep knowlegde of javascript that I simply don't have for MZ


EDIT: ninja'd
@caethyril it seems like it worked like a charm, thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/state-that-prevents-from-equipping-weapon-types.171100/