Magnetic anisotropies and electric field effects for the hydroxyl, amino, chloro and bromo groups