We present the 1.4GHz radio luminosity functions (RLFs) of galaxies in the COSMOS field, measured above and below the $5sigma$ detection threshold, using a Bayesian model-fitting technique. The radio flux-densities from VLA-COSMOS 3-GHz data, are extracted at the position of stellar mass-limited near-infrared (NIR) galaxies. We fit a local RLF model, which is a combination of active galactic nuclei (AGN) and star-forming galaxy (SFG), in 10 redshift bins with a pure luminosity evolution (PLE) model. We show that the evolution strength is similar to literature values up to $zsim 1.6$. Beyond $zsim 2$, we find that the SFG RLF exhibits a negative evolution ($L^*$ moves to lower luminosities) due to the decrease in low stellar-mass sources in our stellar mass-limited sample at high redshifts. From the RLF for SFGs, we determine the evolution in the cosmic star-formation-rate density (SFRD), which we find to be consistent with the established behaviour up to $zsim 1$. Beyond $zsim 1$ cosmic SFRD declines if one assumes an evolving infrared--radio correlation (IRRC), whereas it stays relatively higher if one adopts a constant IRRC. We find that the form of the relation between radio luminosity and SFR is therefore crucial in measuring the cosmic SFRD from radio data. We investigate the effects of stellar mass on the total RLF by splitting our sample into low ($10^{8.5} leq M/mathrm{M}_{odot} leq 10^{10}$) and high ($M>10^{10},mathrm{M}_{odot}$) stellar-mass subsets. We find that the SFRD is dominated by sources in the high stellar masses bin, at all redshifts.