[Solved] With unequip events for plugin

First off I apologize as I'm not entirely sure this post needs to be in requests or support.

I am creating a "dynamic actors" plugin for my project (which will help me tremendously with some automation of character sprites, faces, and battlers) BUT I've run into a snag. Whenever I equip something everything updates just fine... it is when I UN-equip something (like the shield), the graphic is not updating correctly (the problem lies somewhere in the Game_Actor.prototype.changeEquip function obviously. I'm just not fully understanding on how to "get" when an item is unequipped and no other actions are being done.

For example:
var olditem = this.equips()[slotId]; (gets it before the change?)

_alias_Game_Actor_equipChange.call(this, slotId, item);

if (!olditem) return; // if they have not unequipped? or what?

--- What I Need (pseudocode) ---

if unequip (and the item was one of the valid armor types in the array) {
if shield = flip the shield switch to false.
}

I can upload the script to Github if anyone wants to take a look at it. I mean it'd be free for anyone's use at some point although right now it's more tailored to fit just my game (I would like to expand it more in the future for something I'm planning but that's a topic for another time).
Code:
// Store old item.
var oldItem = this.equips()[slotId];

_alias_Game_Actor_equipChange.call(this, slotId, item);

// If current item is not the same as old item and current item is null then the old item got un-equiped.
if (oldItem !== this.equips()[slotId] && !this.equips()[slotId]) {
  // do something here
}
Well that worked! Now all that's left is to merge DreamX's code (he made an 'autoequip' plug for me to ensure a weapon or armor (designated by actor note tags) would be re-equipped if something was unequipped and nothing was left behind in that slot. If it okay to leave this thread open for an additional 48 hours (or up-to) while I try to figure this out. If all is well and good I can request this thread to be closed (else my next reply will be that of more help 😛)

@DrDhoom thank you so much for that portion of assistance (and have included you in credits for it too! lol) Because I really do appreciate it ^_^ So yeah. Expect my next reply within 48 hours!
Alright everything is good 🙂 This thread can be locked now. Thank you again to DrDhoom for all of your assistance!

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/solved-with-unequip-events-for-plugin.103485/