Because much of my drilling consists of selected points I have always been in the habit of defining my drill depths, in this case cycle.depth worked correctly. After messing around it is clear your code was more reliable.
I updated the post to use your code.
getCommonCycle(x, y, (cycle.bottom*-1+cycle.clearance))