Using on-top pair density for construction of correlation functionals for multideterminant wave functions