Can i put condition on material scalar parameters

Suppose i have 2 scalar parameters say metal and rough. I want to put a condition like sum of metal + rough <=1 then only apply on material. How can i do that? And if sum is greater than 1 after incrementing one param then decrement other so that sum remains = 1. E.g metal is 0.7 and rough is 0.3, if i increase metal to 0.8 then rough should go to 0.2 automatically. Can i do such stuff???

In the material editor or in a BP?

i know of away to accomplish something similar which ill show in a picture below. there is a little bit of limitation in what i made and it could be expanded upon but basically the switch decides which is the more prominent stat and selects which set of nodes to use based on a bool parameter. the metal and roughness is just a scalar parameter to set the dominant value then a 1-x to set the other value. i made the values into a float two to make the script clean looking but this could also be done with two switches. hope this gets you on the right track

Any will do, mostly it should be in material editor.

Not sure but looking at it, it wont handle case if metal+rough<1, it will consider 1-x value always.