A lot of their scripts work this way.
It's been a weird ride learning the syntax and how it all functions. It wasn't clicking for me that CharacterGetStat() was required to be in an IF block because returned a variable, haha. Programming habits getting in the way, I guess.
What charscript are you adding your code to for the player abilities?
Hooking directly Player.charScript and adding:
#INCLUDE Base
#INCLUDE Player_StateManager
INIT
USING Base
USING Player_StateManager
EVENTS
This lets me create separate scripts like a state machine to inherit and call from for each player. From there a whole lot can be influenced using On triggers like OnCombat(), OnTurn(), OnTurnEnded(), or even OnDamage(_,_,_,_).
For NPCs I've done the same thing by hooking into DefaultCharacter.charScript.
This way an event can be run on any NPC that receives damage via Damage(_,_,_Char,_) and you can run CharacterHasStatus(_Char, CONSUME, someKindOfCustomBoost) to check if they should do something like simulating an "on hit" effect that would be caused by a buff without having to rely on directly enchanting a weapon.