Hi again 6IV Magikarp! The scripts I showed you
here will work for NPCs too since they are just normal scripts. You might have to edit them to a bit (like adding a yes/no message before selecting a Pokémon for example) but they will work just fine.
If you use JPAN's engine you can both read and edit IVs and EVs. Editing IVs is easy because you just set the new value when you do the special.
EVs are different in that you actually add or subtract from the original value. It doesn't have any kind of checks to make sure that you don't go below zero or above 252 EVs so you have to add those. You also have to have another check when adding EVs to make sure you don't go above 510 EVs total.
Unless you want to make the game completely broken. I won't judge.
Okay maybe I will a little XD
Okay back to being serious. I recommend using the tool (if you can) for using JPAN's engine because from what I've seen the patch has some problems, plus with the tool you can pick and choose what you want to put in (so you don't waste space with specials you won't use). I think somebody re uploaded it after all the attachments on Pokecommunity stopped working, but I don't know where it is.
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo