Setting an actor's EX-Paramater with a formula

Good evening,

In terms of writing a damage formula, how do you set the value of an EX-Parameter, if at all possible? I am looking to change an xparam value of an actor to be inversely proportionate to their HP (in this case, CRI) when a status effect is active, and I can't seem to find a JavaScript code to set the equal to a formula.

I'm looking to do something like this:
user.cri = (1 / (user.hp/user.mhp))
**I know this is not proper JavaScript, but just to give you an idea of what I'm looking for.

I am currently using YEP.50 - Buff and States Core, YEP.69 - Extra Parameter Formulas, and YEP.12 - Auto Passive States.

Thank you for your time.
this will do it: http://yanfly.moe/2015/11/08/yep-26-critical-control/
I will have to edit my original post, my apologies for not being specific.

I'm looking for a way to change X-Params through the use of a formula that is through a passive state that is applied. So the conditions would be that if passive state X is applied to the actor, then they would have their X-Param (in this case, CRI) set equal to a damage formula.

This is what I have so far in the State notebox:

<Custom Action Start Effect>
if (user.result().isStateAdded(4)) {
var user = $gameActors.actor(actorId);
user.cri = (user.hp/user.mhp)
}
</Custom Action Start Effect>

The underlined section is what I'm looking to replace with a formula. I do not believe user.cri can be set with a '=' operator.
Did you ever figure this out OP?

Original thread: https://forums.rpgmakerweb.com/threads/setting-an-actors-ex-paramater-with-a-formula.92005/