It only works for preconfigured monsters. ERM help has a list of what works this way. You can recreate the monster to enable this command, as all monsters placed via ERM will have necessary data.
Also it's slightly less than 5% chance in your code, because y2 can take on 101 different values (from 0 to 100).