fields and expansion

Can you write down a general relationship for the energy density of a massive scalar field on a FLRW-background with scale factor \(a\) that reproduces the well-known results \(\rho\propto a^{-3\ldots -4}\) for non-relativistic and relativistic particles, respectively?