Yes this question has been asked before, but thing is the normal isometric planes its usually quite safe to assume you want th closest point to the plane But when aligning to A random plane its not really so self evident. Mainly because people donut usually see hat in action so the effect is a bit surprising.
Is this what you truly need this make a locator, align it to your surface. select the vertices you wanted to flatten. run:
cluster -bs 1 -wn locator1 locator1
Where locator1 is your locator name. Scale locator to 0 in whichever axis you wanted.