Well an obvious hack would be just to remove the shadow from the gani and draw another shadow but I figure you want to avoid that.
Shot in the dark.. pass the z value as a parameter and set it in the gani script:
PHP Code:
SCRIPT
function onPlayerEnters() {
this.z = params[0];
}
SCRIPTEND