Project point to navigation

Could you please talk more about how to pick a point on the navmesh close to an off-mesh point?
So the problem is the target (usually the player can be off-navmesh) so I’d like to make the AI move to it as close as possible.
Also, I don’t want the AI to lose aggro on an off-mesh target so can I ask if there is a way to check whether the target (off-mesh) is still within a range to the on-mesh NPC?