Weapon's stats changing depending on state categories.

Hello everybody!
I am trying to make a rather simple thing. A weapon that has default stats but if the enemy is affected by a state category it will
increase those stats a bit.
Right now it looks like this on the weapon's notetags:

Code:
<atk: +2>
<Custom Parameters>
if (target.isStateCategoryAffected('Beast')) {
atk += 5
}
</Custom Parameters>

I have a passive state with the state category on the enemy I want but the atk stat doesn't increase.
Thank you in advance!
Bump
I think the problem here is that target only exists during the execution of an action, so theoretically, your weapon will only have increased attack during that action, that is if the weapon's atk is even being evaluated during that time.. That's a possibility for the case anyway.

Also please tell us and post a link to the plugin that you are using which gives you the notetag <Custom Parameter>
Oh sorry, I'm using yanfly's State categories and Equip core which you can find here http://yanfly.moe/yep/changelog/
I use all of yanfly's plugins so there might be a different way of doing this with a different plugin in the list?
Bump
Bump, no one?
I think the problem here is that target only exists during the execution of an action, so theoretically, your weapon will only have increased attack during that action, that is if the weapon's atk is even being evaluated during that time.. That's a possibility for the case anyway.

If this is the case, maybe Yanfly's Damage Core could help? That plugin allows you to change the order in which damage is calculated when you attack.
If this is the case, maybe Yanfly's Damage Core could help? That plugin allows you to change the order in which damage is calculated when you attack.

I don't think so because as far as I understand yanfly's damage core plugin, you can't use the <damage formula> script on armor or weapons. only on skills and items.
What I need is a weapon that changes it's atk depending on the target.

Original thread: https://forums.rpgmakerweb.com/threads/weapons-stats-changing-depending-on-state-categories.106304/