Cavity cooling of translational and ro-vibrational motion of molecules: ab initio-based simulations for OH and NO