Set the cursor position

I’m trying to set the cursor position if a certain condition is true, but I can’t figure out the method. Can someone show me the code to do this?

You can use a paid asset from the asset store like this one: Set Cursor Position + Mouse Clicks API | Input Management | Unity Asset Store
But it only works for windows so far.