Inversion barriers in NH2X, PH2X, NHXY, and PHXY species