okay, here\'s an example, translate it into your code.
var %maxhp = 10, %myhp = 40, myhpremain = %myhprem = $calc(%maxhp - %myhp) msg $chan <color> $+ $str(|,%myhp) $+ %myhp $+ <color> $+ $str(|,%myhprem)
.. It will work if you apply it correctly >.>