okay, so I'm currently trying to "fix" my class's charge bar skill [Respite] to re-balance the challenges a bit.
TLDR, I need help with [Stat] and understanding how Engineer Charge Bar works
Here's how to skill works:
Whenever the caster cast [a certain skill] that consume a charge (like engineer), if it's an defensive buff it'll proc [Respite], which grant affected allies 3 sec of bubble, and a bunch of status resistance. The damage absorbed by the bubble are affected by caster's level.
Now my problem is that initially, I didn't want to the bubble to be invulnerable, which means if players went and bit more than they can chew, the bubble will break, along with all of its benefit. I had a nice balance figure to work it out when leveling in game, including [Path of Torchlight] mod by
@Darkthan9800 Up until I try Synergies Darkness Fall
Even mini bosses start 1 shot the bubble whenever I cast it. So in the end I had to bump up the numbers to ludicrous amount to suffer at least 1 hit from bosses, resulting completely OP in leveling period, and I want my class to be enjoyable during leveling and not just endgame, many hours had been put into thoughts and play test to ensure that too (at least for me)
I had an idea currently to make it work. First I create a [Stat] just like railmanchargebonus, and when I cast [a certain skill], It'll [convert charges to stat], and the bubble will have the [stat name] and [stat percent] base on such. Here's what I did with [Salvation]. note that [Respite] does not only proc from this skill, there's other skill that proc this skill as well.
[LEVEL1]
[EVENT_START]
<BOOL>ATTACHES:1
[STATWATCHER]
<STRING>STAT:PLAYER CHARGES
<STRING>PRIMARY_TARGET_TYPE:SELF
<STRING>SECONDARY_TARGET_TYPE:VALUE
<STRING>WATCH_TYPE:LESS THAN
<FLOAT>SECONDARY_VALUE:1
[/STATWATCHER]
[/EVENT_START]
[EVENT_START]
<STRING>FILE:media/skills/lightbringer/chargedeffect/judgement_warmup.layout
<BOOL>ATTACHES:1
<BOOL>STATSHIDDEN:1
[STATWATCHER]
<STRING>STAT:PLAYER CHARGES
<STRING>PRIMARY_TARGET_TYPE:SELF
<STRING>SECONDARY_TARGET_TYPE:VALUE
<STRING>WATCH_TYPE:GREATER THAN
<FLOAT>SECONDARY_VALUE:0
[/STATWATCHER]
[EFFECTS]
<STRING>TARGET:SELF
[EFFECT]
<STRING>NAME:lightbringer_respite <= the stat name
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:CONVERT CHARGE TO STAT
<FLOAT>VALUE:0
[/EFFECT]
[/EFFECTS]
[/EVENT_START]
[EVENT_TRIGGER]
<STRING>FILE:media/skills/lightbringer/salvation/salvation placeholder 1.layout
<BOOL>NOSTEALEFFECTS:0
<BOOL>STATSHIDDEN:1
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PET
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:SELF
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PLAYER
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[STATWATCHER]
<STRING>STAT:LIGHTBRINGER_RESPITE
<STRING>PRIMARY_TARGET_TYPE:SELF
<STRING>SECONDARY_TARGET_TYPE:VALUE
<STRING>WATCH_TYPE:LESS THAN
<FLOAT>SECONDARY_VALUE:1
[/STATWATCHER]
[/EVENT_TRIGGER]
[EVENT_TRIGGER]
<STRING>FILE:media/skills/lightbringer/salvation/salvation placeholder 1.layout
<BOOL>NOSTEALEFFECTS:0
<BOOL>STATSHIDDEN:1
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PET
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:SELF
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PLAYER
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[STATWATCHER]
<STRING>STAT:LIGHTBRINGER_RESPITE
<STRING>PRIMARY_TARGET_TYPE:SELF
<STRING>SECONDARY_TARGET_TYPE:VALUE
<STRING>WATCH_TYPE:GREATER THAN
<FLOAT>SECONDARY_VALUE:0
[/STATWATCHER]
[EXECUTE_SKILL]
<STRING>SKILL:RESPITE - 6M <= Executed [Respite] here, same as other skills who proc this
[/EXECUTE_SKILL]
[EFFECTS]
<STRING>TARGET:SELF
[EFFECT]
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:ADD CHARGES <= Reduce charge by 1 after said [stat] have calculate the total charge before deduction
<FLOAT>MIN:-1
<FLOAT>MAX:-1
[/EFFECT]
[/EFFECTS]
[/EVENT_TRIGGER]
[EVENT_TRIGGER_FOUR]
[AFFIXES]
<INTEGER>AFFIXLEVEL:1
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PET
<STRING>AFFIX:LIGHTBRINGER_SALVATION_1
[/AFFIXES]
[/EVENT_TRIGGER_FOUR]
[/LEVEL1]
And there's [Respite] that proc;
[SKILL]
<STRING>NAME:Respite - 6m
<TRANSLATE>DISPLAYNAME:Respite
<STRING>SKILL_ICON:skillicon_divineshield
<STRING>ACTIVATION_TYPE:NORMAL
<STRING>TARGET_ALIGNMENT:GOOD
<FLOAT>RANGE:10
<FLOAT>FINDTARGETANGLE:360
<FLOAT>TURNRATEOVERRIDE:-1
<BOOL>HIDDEN:1
<BOOL>CAN_BE_SILENCED:0
<INTEGER64>UNIQUE_GUID:1779625509979859292
[LEVEL1]
[EVENT_START]
<STRING>FILE:media/skills/6m aoe.layout
<BOOL>STATSHIDDEN:1
<BOOL>CAN_CLONE:0
[AFFIXES]
<STRING>TARGET:SELF
<STRING>AFFIX:LIGHTBRINGER_PROC_RESPITE2
[/AFFIXES]
[AFFIXES]
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PET
<STRING>AFFIX:LIGHTBRINGER_PROC_RESPITE2
[/AFFIXES]
[AFFIXES]
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PLAYER
<STRING>AFFIX:LIGHTBRINGER_PROC_RESPITE2
[/AFFIXES]
[/EVENT_START]
[EVENT_END]
<BOOL>CAN_CLONE:0
[EFFECTS]
<STRING>TARGET:SELF
[EFFECT]
<STRING>NAME:lightbringer_respite
<STRING>ACTIVATION:DYNAMIC
<STRING>DURATION:INSTANT
<STRING>TYPE:CLEAR STAT <= Clearing [stat] to avoid multiple stack that can benefit other [Respite] proc
<FLOAT>MIN:0
<FLOAT>MAX:0
<FLOAT>CHANCE:100
[/EFFECT]
[/EFFECTS]
[/EVENT_END]
[/LEVEL1]
[/SKILL]
And it worked, to some point.
[Respite] will now scale with my charge bar, as well as character level. I can tweak the [stat percent] at the affixes to fit my intended play style.
But for some reason after the 1st cast from a "drained charge bar" (always the first cast), the 1st cast would show the correct about, but the next cast, no matter how many charges I have, it'll always add 1 more extra charge to it, and only once. After that its back to normal again.
And for some reason, it now instead of deducting 1 charge, it deletes everything.

I've been scratching my head for days with this one. If anyone have any idea where I did wrong, I'm ready to learn.

p/s: sorry for the wall of text, I type this ASAP while baby sitting. Didn't noticed I had so much here