As suggested in my comment, define $h^*_p(a)$, as Fuchs does, to be the smallest ordinal $\sigma$ with $a\not\in p^{\sigma+1}A$ if there is such a $\sigma$, but if there is no such $\sigma$ then define $h^*_p(a)=\infty$, where $\infty$ is just a symbol that is defined to be greater than every ordinal.
If $\varphi:A\to B$ is a homomorphism, then since $\varphi(pA')\leq p\varphi(A')$ and $\varphi\left(\bigcap_iA_i\right)\leq\bigcap_i\varphi(A_i)$ for subgroups $A',A_i$ of $A$, a straightforward transfinite induction shows that $\varphi(p^\alpha A)\leq p^\alpha B$ for every ordinal $\alpha$, and so $h^*_p\left(\varphi(a)\right)\geq h^*_p(a)$ for every $a\in A$ (including the possibility that $h^*_p(a)<\infty$ but $h^*_p\left(\varphi(a)\right)=\infty$, or that $h^*_p(a)=\infty$, in which case $h^*_p\left(\varphi(a)\right)$ is also necessarily $\infty$).