Just a thought. As Cmu is used to calculate Turbulent Viscocity, why don't you try writing a UDF (as per your requirement) for the turbulent viscosity itself.
Frankly, I am not sure if it is possible to make Cmu variable for Standard or RNG k-epsilon model. For Realizable, it is by default a variable. To know more, refer to this section of the Theory Guide: 4.3.3. Realizable k-ε Model (ansys.com)