  We present the evolution of the structural, electronic, and lattice dynamical
properties, as well as the electron-phonon coupling and superconducting
critical temperature ($T_c$) of ScH$_2$ and YH$_2$ metal hydrides solid
solutions, as a function of the electron- and hole-doping content. The study
was performed within the density functional perturbation theory, taking into
account the effect of zero-point energy through the quasi-harmonic
approximation, and the solid solutions Sc$_{1-x}M_{x}$H$_{2}$ ($M$=Ca,Ti) and
Y$_{1-x}M_{x}$H$_{2}$ ($M$=Sr,Zr) were modeled by the virtual crystal
approximation. We have found that, under hole-doping ($M$=Ca,Sr), the ScH$_2$
and YH$_2$ hydrides do not improve their electron-phonon coupling properties,
sensed by $\lambda(x)$. Instead, by electron-doping ($M$=Ti,Zr), the systems
reach a critical content $x \approx 0.5$ where the latent coupling is
triggered, increasing $\lambda$ as high as $70\%$, in comparison with its
$\lambda(x=0)$ value. Our results show that $T_c$ quickly decreases as a
function of $x$ on the hole-doping region, from $x=0.2$ to $x=0.9$, collapsing
at the end. Alternatively, for electron-doping, $T_c$ first decreases steadily
until $x=0.5$, reaching its minimum, but for $x > 0.5$ it increases rapidly,
reaching its maximum value of the entire range at the
Sc$_{0.05}$Ti$_{0.95}$H$_2$ and Y$_{0.2}$Zr$_{0.8}$H$_2$ solid solutions,
demonstrating that electron-doping can improve the superconducting properties
of pristine metal hydrides, in the absence of applied pressure.
