# How would you change the apparent and absolute magnitude relation to use it in cosmology?

How would you modify this relationship to use it in cosmology, where distances are given in units of $$h^{-1}$$Mpc?

$$\begin{equation} \label{eq1} \begin{split} m - M & = 5\log_{10}\Big(\frac{d}{10pc}\Big) \end{split} \end{equation}$$

The distance modulus is used in cosmology exactly as you quote it. The $$h^{-1}$$ Mpc units are not used universally in cosmology either. It's better to use appropriate units for whatever the situation is.
The parameter $$h^{-1}$$ is simply the inverse of the dimensionless Hubble parameter and is hence just a number, typically quoted as around $$h = 0.7$$. You have quoted the distance modulus in units of $$10$$pc; all you need to do is convert that to Megaparsecs.
For the distance, $$d$$, in parsecs, the distance modulus is $$m-M = 5 \log_{10} \frac{d}{\rm pc} - 5$$.
One Megaparsec is $$10^6$$ parsecs, i.e. $$1$$ pc = $$10^{-6}$$ Mpc.
\begin{align} m -M &= 5 \log_{10} \frac{d}{10^{-6}\rm Mpc} - 5, \\ &= 5 \left( \log_{10} \frac{d}{\rm Mpc} + \log_{10} 10^6 \right) - 5, \\ &= 5 \log_{10} \frac{d}{\rm Mpc} + 5\cdot 6 -5, \\ &= 5 \log_{10}\frac{d}{\rm Mpc} + 25. \end{align}
For the distance, $$d$$, in Megaparsecs, the distance modulus is therefore $$m-M = 5 \log_{10} d + 25$$.