Sorry I hope I'm not 'stealing' your thread

I'm sure your gravity works more realistically than this but this is a general function I use:

//using z_dist, gravity etc as skill defines, this function returns my.move_z which you can then use in a c_move instruction

Code:

FUNCTION handle_gravity() {
result = c_trace(my.x,vector(my.x,my.y,my.z - 4000),use_polygon|use_box|ignore_me|ignore_passable); //you may use a different trace_mode
my.z_dist = result - 3; // placing the entity a little above ground to stop c_move ellipoid hull collision with ground
IF (my.z_dist < 3) {
my.force_z = -1 * my.z_dist;
} ELSE {
my.force_z -= my.gravity * time; //how fast we accelerate
my.force_z = max(-60,my.force_z); //maximum velocity
}
my.velocity_z += (time_step * my.force_z) - (min(time_step*0.7,1) * my.velocity_z);
my.move_z = my.velocity_z * time_step;
IF (my.z_dist < 0) { my.move_z = -my.z_dist; } //if we are below the ground place entity above ground
}