Force unequip weapon when parameter falls Plugin

Hi everyone,
I need a (hopefully simple) simple plugin that will unequip armor X when a parameter is no longer the highest. I'm using Yanfly's equipment restrictions plugin to make armor x equipable only when a parameter (e.g. atk) is greater than every other parameter, but if atk falls below another parameter, the armor stays equipped, which is unfortunate.

Thanks
I can probably do this, but it would be useful to know where in particular you want equipment to be removed. For instance, do you want the equipment to be removed in battle because the actor has had their def buffed and that is now their highest stat? Do you want the equipment to be removed in the Equip Scene when the actor changes their equipment and changes their stats?
If it's not too much work, I'd really appreciate it.
I have out-of-battle conversations with choices which change parameters. In the world screen, if you go up to a certain character they will ask a question and if you choose option 1, your atk raises but def lowers and if you choose option 2 the def raises but atk lowers. I want the game to check to see if atk/def/mat/mdf/agi is still the highest parameter after these choices and then unequip the armor if it has fallen below another parameter.
If the game can't be made to automatically check parameters, I was thinking of running an event after each choice to check if X is still the highest parameter.
Alright, give this a try. It adds a second check for items that the character shouldn't be able to equip and will remove them any time the actor is refreshed (eg parameter change), I've suppressed any changes from happening whilst in battle. Once you've installed the plugin you should be good to go. If there's any issues give me a shout. Download here
@Silva I appreciate this so much! I can't seem to get it to work though 🙁
I set up a simple test with three map buttons to raise atk, lower atk, and raise def. When I turn on the plugin, it doesn't seem to have any effect. Raising def over atk doesn't unequip the atk item 🙁
Ok, let's run through a few things:

1) Make sure your plugins are ordered correctly - ie:
YEP_EquipCore
YEP_X_EquipRequirements
SilvaYanflyEqReqForceUnequip
2) Make sure you're starting a new game to test this, loading an old saved game after changing the plugin list can cause problems.
3) If you have any other plugins loaded try turning them off, it may be something is conflicting with my plugin or Yanfly's and we need to address that.
4) I'm not sure how you're changing the parameters, but try using normal event commands - these will trigger the actor's refresh function and in turn mine.

If none of those solve the issue could you provide me with a screenshot of the armour/weapons note box to confirm that the eval is correct?

How familiar are you with using the console? I may ask you to put some commands in there just so I can see where things are going wrong if none of these steps work.
Thanks so much for the help. I discovered that the problem was Yanfly's Base parameter control plugin. I don't even know why I had that activated. I deleted that and your plugin is working perfectly. Thanks!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/force-unequip-weapon-when-parameter-falls-plugin.107672/