WTH can't automations persist an action based on state

For example I’d like to ensure that a light has a maximum brightness value of 50% but only whilst a toggle is on.

At the moment the only way to achieve this type of functionality is to monitor a change in brightness or light state and then apply the desired light brightness.

I’d like the brightness to only ever be 50% any time the light is on and the condition is met.

I may be asking for the same thing or for something which isn’t possible.