Using a button to control a conditional activation group

Is it possible to create a Touch Bar button that activates a conditional activation group when it is pressed?

I was thinking I could set a button to toggle a true/false custom variable each time I press it, and set the CAG conditions to activate when a true value is returned. I'm correct in thinking this is possible, right?

My coding knowledge is slim to none, I tried for quite a while to understand the way the custom variables work but I couldn't figure it out, and wasn't able to figure out how to edit them.

As long as this is possible, I need to know (step by step) how to edit the custom variables, and how to code a button to toggle the variable's value.

The easiest way is to use the predefined action "Assign value to variable"

And then use it in the CAG like this:

So this reply helped a lot, and I've created two named triggers that assign a true/false value to customVariable1. How do I go about creating a button to toggle between the two?

I've messed around with the code for quite a while now and I can't seem to get it to switch the return value. I've done it as a direct command (set_string_variable "customVariable1" to "true/false") and as a named trigger command (execute_assigned_actions_for_trigger "(UUID)"). I've also tried using a whole if/else command as well as two separate if commands.

For whatever reason, no matter what I do, I can only get a "false" value to return. I know both of my triggers work, it's just automating the process that runs them in alternation based on their current values.