[SOLVED]Yanfly's Item Durability Plugin: Change an Item's durability through scripts?

Need help with: Yanfy's "Item Durability" plugin

Hey, thanks for checking out this post! I'm trying to make a game which requires me to manually lower or up the currently equipped weapon's durability during an event. I was wondering if there is a way I could do this through scripting or if I need a whole other extension plugin to make it work.

Please let me know what you think!

Edit: And if you know how to do this through scripts, please show me how! I have no idea how coding works. 😅

Thank you! 😍​
Need help with: Yanfy's "Item Durability" plugin

Hey, thanks for checking out this post! I'm trying to make a game which requires me to manually lower or up the currently equipped weapon's durability during an event. I was wondering if there is a way I could do this through scripting or if I need a whole other extension plugin to make it work.

Please let me know what you think!

Edit: And if you know how to do this through scripts, please show me how! I have no idea how coding works. 😅

Thank you! 😍​
run this script $gameActors.actor(x).equips()[y].durability -= 5 to reduce 5 point from actor x 's equipment slot y
ex: to reduce actor1 weapon by 5 point we run this:
$gameActors.actor(1).equips()[0].durability -= 5
This works, but unfortunately if the durability number becomes a negative it transforms into an unbreakable for some reason. Any idea on how to fix this? :\
This works, but unfortunately if the durability number becomes a negative it transforms into an unbreakable for some reason. Any idea on how to fix this? :\
var mitem = $gameActors.actor(2);
mitem.equips()[0].durability -= 5;
if (mitem.equips()[0].durability <= 0) {mitem.durabilityBreakItem(mitem.equips()[0]);}
This works fantastically! Thank you so much for your help! I'll make sure to credit you in-game! 👋

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-yanflys-item-durability-plugin-change-an-items-durability-through-scripts.91228/