According to the built in documentation, gettrackedvariable is deprecated. However, no alternative is listed. This is very unhelpful. Also settrackedvariable is not deprecated, so this seems a bit inconsistent.
I am using a tracked variable to calculate cumulative costs, like so:
settrackedvariable("Cost", gettrackedvariable("Cost"), cost_per_time);
The cost_per_time varies, so I just want to adjust the rate, not value.