The problem is your "creatureref" variable. Nothing sets it, so its always null, and so the cast function will always fail. Just take it out completely.
scn AMexplodescript01begin OnHit if ( getactorvalue health <= 15 ) cast AMexplodeinfernal endifend
This must be an object script on the creature, so all functions are implicitly referencing it. The "cast" should not need a target for an "on self" spell. Note that I changed it from "gamemode" to "onhit" otherwise you could get multiple hits in between passes of the script, and also it would constantly be checking while there's no combat going on.
However, this still won't work if your attacks on the creature do more than 15 damage (which is very likely to be the case later in the game) as on one hit, the health will be above 15 and the script won't do anything, and on the next, it will be 0 and the creature will already be dead, and unable to cast. You may want to revise that check to a percentage of max health (so that it levels with the creature), or add another mechanism for that in an "ondeath" block.