how do you add variables to enemy stats?

As an example; let's say I wanted to add the value of variable [170] to my enemy's Attack.

 

In VX Ace I would add this script to my event:

 


val = $game_variables[170]

if $game_troop.members[0] != nil

  $game_troop.members[0].change_param(2, 

val)

end


 

I can't remember if it was necessary to change anything in the script editor or not.  I tried to locate the the older thread where this problem was solved but had no luck.

 

Does anyone know how to to accomplish this on MV?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-add-variables-to-enemy-stats.48880/