You could try:
Step Event (of something)
if(window_mouse_get_y() > 500){ // alter the 500 to the max you want
window_mouse_set(window_mouse_get_x(), 500); // places the mouse back to 500 max.
}
If the current mouse Y position in the game window is greater than 500 then the mouse Y position is set at 500, thus preventing the mouse going outside whatever max you set.
You can also prevent it moving less than a specific Y.
if(window_mouse_get_y()< 32){ // alter the 32 to the min Y you want
window_mouse_set(window_mouse_get_x(), 32); // places the mouse back to 32 mimimum.
}
Note that GM adapts the display when running in full screen so the x,y mouse positions in the window can vary.