# RMMVSet PM equal to the value of a variable.

#### Domagames

##### Villager
Good afternoon, I am looking for a way to establish the PM of an actor, based on the value of a variable. Under normal circumstances, the value of the variable is added or subtracted, but not the exact value. I need a plugin or code script pls.

#### Ms Littlefish

##### Time Traveling Victorian Vampire
I have moved this thread from JS Plug-in Releases to JS Plugin Requests.

#### Andar

##### Regular
And what is that PM you want?

If you're talking about MP or similar values, the trick is mathematics: use two commands (one substraction and one addition) to calculate the difference you need to add.

#### caethyril

##### ^_^
E.g. "current MP + (50 - current MP)" = 50:

```◆Comment：Get difference from target value ◆Control Variables：#0005 Difference = 50 ◆Control Variables：#0005 Difference -= MP of Harold ◆Comment：Gain that much MP ◆Change MP：Harold, + {Difference}```
You can get an actor's current MP using Control Variables -> Game Data -> Actor -> MP. In this example the target value was simply 50, but it could easily be something else.

#### Domagames

##### Villager
And what is that PM you want?

If you're talking about MP or similar values, the trick is mathematics: use two commands (one substraction and one addition) to calculate the difference you need to add.
Yes, is the MP. Whats commands should be in this case?

#### Andar

##### Regular
all the command you need is control variable and change MP exactly loike in the example caethyril gave above

#### Domagames

##### Villager
E.g. "current MP + (50 - current MP)" = 50:

```◆Comment：Get difference from target value ◆Control Variables：#0005 Difference = 50 ◆Control Variables：#0005 Difference -= MP of Harold ◆Comment：Gain that much MP ◆Change MP：Harold, + {Difference}```

You can get an actor's current MP using Control Variables -> Game Data -> Actor -> MP. In this example the target value was simply 50, but it could easily be something else.
Thanks, this was the solution.

### Latest Profile Posts

Looooooonnnnggg maaaaannnnn
Yknow what? Im seriously considering recruiting a manager to oversee my games development.
Because I cannot focus or complete these tasks by myself. I need someone to give me orders, without having them be my boss.

Remember my latest plugin for rpg maker mz:

Acknowledgement Window is now available!

Take a look here:

Got my focus back, 9/59 maps have the door fix in place now.