How to remove/delete currently equipped weapon via script?

I figured this would be real simple using a script call, as I can't figure it out via eventing - but all the threads I look up give me code for Ace lol

So what I need to do is remove the currently equipped weapon from not only the actor, which will always be Actor 1, but then remove that specific weapon from the inventory. I am using Yanfly's Item Core and AttachAugments, so just using events to remove the weapon from the inventory might grab the wrong instance of the independent item.

Basically I'm trying to make an event that allows the player to scrap their currently equipped gear for crafting materials. My only issue is that there are dozens of Augments the player can find and attach to their weapons resulting in having multiples of the same weapon, just with different augments. So I figured having only the currently equipped gear be 'selectable' for scrapping would make this easier, but if anyone has a better idea I am certainly all ears.

Thanks.
You could try this in a Script command:
JavaScript:
$gameActors.actor(1).forceChangeEquip(0, null);
Replace 0 with the slot ID: 0 for the first equip slot, 1 for the second slot, etc.

forceChangeEquip skips the "trade with inventory" step, so you don't need to worry about manually finding/removing the unequipped item. (You might need something extra to remove remaining references to the item, I haven't checked how Item Core handles that.)

Alternatively, this plugin may be relevant:
You could try this in a Script command:
JavaScript:
$gameActors.actor(1).forceChangeEquip(0, null);
Replace 0 with the slot ID: 0 for the first equip slot, 1 for the second slot, etc.

forceChangeEquip skips the "trade with inventory" step, so you don't need to worry about manually finding/removing the unequipped item. (You might need something extra to remove remaining references to the item, I haven't checked how Item Core handles that.)

Alternatively, this plugin may be relevant:
Works perfectly! Thank you so much!
Great! Happy RPG Making~ 😂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-remove-delete-currently-equipped-weapon-via-script.154439/