(function()
{
var saveTheOriginalChangeEquip=Game_Actor.prototype.changeEquip;
Game_Actor.prototype.changeEquip = function(slot, item)
{
if (item)
{
var match = item.note.match(/.*<notetag>.*/i);
if (match)
{
//do stuff
}
saveTheOriginalChangeEquip.call(this,slot,item); //then equip it
}
else
{
//Check the gameActor who called this
//Check the slot to unequip
//Check the item's notetag
//undo stuff
saveTheOriginalChangeEquip.call(this,slot,id); //then unequip it
}
}
})();