Dynamical and spectroscopic study of internal rotation in formic, thiolformic, thionformic and dithioformic acids using a reduced potential model