Solved - Breakable Weapon

Need some help with skill code.

I made skill that random discard user's weapon when use to simulate "Weapon that randomly break when use" by use YEP Battle Engine Core.

This is the code.

Spoiler: Code
<After Eval>
var brake = 0.3;
var etherdagger = $dataWeapons[33];
if (user.currentAction().item().id === 141) {
if (Math.random() < brake) {
if (user.hasWeapon(etherdagger)) {
user.discardEquip(etherdagger);
AudioManager.playSe({name: 'crash', pan: 0, pitch: 100, volume: 90});
var text = 'Ethereal Dagger Break !';
var window = SceneManager._scene._logWindow;
window._lines.push(text + '<CENTER>');
window.refresh();
}
}
}
</After Eval>

Everything run fine but It won't discard user's weapon.

I test by change condition to discard armor by change $dataWeapons[x] to $dataArmors[x] and it discard equiping armor like I intend.
But when use with weapon it won't work even i set every equip slot can be empty.

Any ideas?
bump
What happens if you use the console to run this code on an actor equipped with the weapon?

Code:
$gameActors.actor(id).discardEquip($dataWeapons[33])

I tend to find it helpful when trying to find out what the issue is to use console.log("part 1 start") or something similar after any branch or loop to see how far the code is evaluating, that way I can pinpoint where there are problems.
I already found problem and solved it already.

It won't discard Independent item (in YEP Item Core).
So I change it into normal item and it works now.

Thanks for reply anyway.

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-breakable-weapon.106435/