Calculating percentage is simple:
(a / b) * 100
so replace a with $gameActors.actor(n).hp
then replace b with $gameActors.actor(n).mhp
multiply it by 100 and you get result in percentage.
Oh, to get more precise result, use Math.floor() function
example:
var x = Math.floor((a/b)*100);