Use javascript variables in custom conditionnal fields / calculate value of a key


I’m trying to trigger a timeline only if a variable is igual to something but it does not seem to be working :

I setted a global variable in js to 0 in my head script.

When trying to retrieve my variable from custom JS in an event it’s ok I can get the correct value.

Now on a click of a button I need to increase/decrease it’s value so variable++ / variable–

Then I try to restart a timeline and i’m using the “conditionnal field” “custom” → in the if condition : ( myVar == 0 ) but it’s not working.

I assume we can’t read the value of a variable in this conditionnal field so I tried to set a session variable but can’t find how to increase / decrease the content of the session variable I need to insert a value, any way to say “value–” or “value++” ?

Thanks a lot for your clues !