MZ How to get a State Attack Skill to override a Weapon Attack Skill?

Hello,

I'd like to make a State that changes the Attack Skill of the unit that has it, but if that unit has a weapon with an Attack Skill, the weapon's skill takes priority.
If there is any way to do this the other way around, perhaps through VisuStella's plugins, any advice would be greatly appreciated.
If I understood it correctly it picks the highest skill id when there's multiple attack skill traits. So arrange the skills to take that into account. Or write exceptions in the attackSkillId function.
Oh, that seems to have fixed it. Odd how it works that way. Thank you so much for the help!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-get-a-state-attack-skill-to-override-a-weapon-attack-skill.179868/