Treat it as bool (implicit conversion to bool and back):
CVar1->Set(SSAO)
CVar4->Set(!SSAO)
Also 88 line can be written as SSAO = (bool)NewValue
. While it’s not full equivalent (the behaviour for negative values will differ), it’s still the same in the main usecases, while being more readable imo.