It's an attr:accesory or something like that. There must be a class related to the Pokemon itself, you know, were you see every pokemon term, like: hp, atk, happiness, speed, etc... I did it on my game: a happiness checker which tells how the relationship is. About the HP, you should put:
if pokemon.hp<50(or anything, it could be a variable too) (play "cry%3.wav",100,60) (which could mean the pokemon's cry will low its pitch to 60 and the volume will be 100, for example).
Again, i'm not being too much of a good help beacuse i have not installed RMXP on this computer.