  In this paper we introduce the new notion of complex isoparametric functions
on Riemannian manifolds. These are then employed to devise a general method for
constructing proper $p$-harmonic functions. We then apply this to construct the
first known explicit proper $p$-harmonic functions on the Lie group semidirect
products $\mathbb{R}^m \ltimes \mathbb{R}^n$ and $\mathbb{R}^m \ltimes
\mathrm{H}^{2n+1}$, where $\mathrm{H}^{2n+1}$ denotes the classical
$(2n+1)$-dimensional Heisenberg group. In particular, we construct such
examples on all the simply connected irreducible four-dimensional Lie groups.
