MV Simple Unarmed Equip

Hi, I'm looking for a plugin that will make it so when an actor has an empty 1st slot, the game will automatically use the weaponID #1 as a filler instead. This is because my skill formulas has a "a.equips()[0]._weaponDamage" component, which is a property I added via Yanfly's <On Creation Eval> tag. Thanks!
Hello!

Creating a plugin just for this is kind of unnecessary, I believe it is possible to do by events using "Conditional branching".

But if you need the command, it's pretty simple:
$gameActors.actor(Actor ID).changeEquipById(param1, param2);
param1 = Type
param2 = Weapon on invetory

Check Slot Weapon
$gameActors.actor(Actor ID)._equips[0]._itemId

Example, Harold -> Check Slot Weapon -> autoequip #1 weapon on inventory:
JavaScript:
if($gameActors.actor(1)._equips[0]._itemId < 1){
   $gameActors.actor(1).changeEquipById(1, 1);
}

On Page Event:
Code:
◆Script:if($gameActors.actor(1)._equips[0]._itemId < 1){
:      :   $gameActors.actor(1).changeEquipById(1, 1);
:      :}

Then I'll see if I can create a Plugin that only checks the members in the "Party" who are without Weapon

Good luck
Thanks! Although I did find a workaround earlier, which was a bit tedious. Basically, I had to add a conditional in all my skill formulas...
Before: a.atk ** (1 + a.agi / 1000) + a.equips()[0]._weaponDamage
After: a.atk ** (1 + a.agi / 1000) + (a.equips()[0] ? a.equips()[0]._weaponDamage : 0)
That way, the formula won't return a null value if the user doesn't have a weapon equipped lol.

Original thread: https://forums.rpgmakerweb.com/threads/simple-unarmed-equip.138487/