MZ [RMMZ] Visustella - Skills & States script help

Hey, so I'm trying to create four accessories: two of which will decrease by 1 the turns of any ailments/stat debuffs that affect the user, and two of which will instead increase by 1 the turns of all positive stats/stat buffs, respectively.

I'm struggling to figure out how to make the script for that since using the same keywords and logic that Yanfly used in his plugins to modify state stats and check for state categories is not doing anything, and Visustella's plugins are all encrypted.
Here's what I tried to do for the first one, the Tenacity Charm that decreases the turns of ailments:

JavaScript:
<JS Post-Apply as Target>

var states = target.states();

for(var i = 0; i < states.length; i++){

var st = states[i];

if(st.category.includes('ailment').toUpperCase){

target.setStateTurns(st.id, target.stateTurns(st.id.turns)-1);

}

}

</JS Post-Apply as Target>

All my states are properly categorized too
Can someone lend a hand?
categories

includes("ailment".toUpperCase())

EDIT: target.stateTurns(st.id)-1
categories

includes("ailment".toUpperCase())

EDIT: target.stateTurns(st.id)-1
Hey, sorry for the long time to respond, only got time to try it now
Ignore the console log lines, it was for testing
Thanks for the help!

JavaScript:
<JS Post-Apply as Target>
console.log("INITIATING TENACITY");
var states = target.states();
for(var i = 0; i < states.length; i++){
var st = states[i];
console.log(st);
console.log("CATEGORIA É:"+st.categories);
if(st.categories.includes("NEGATIVE")){
console.log("É AILMENT");
target.setStateTurns(st.id, target.stateTurns(st.id)-1);

}
}
</JS Post-Apply as Target>

Original thread: https://forums.rpgmakerweb.com/threads/rmmz-visustella-skills-states-script-help.179927/