  The implementation of electron- and hole-doping, in conjunction to applied
pressure, is analyzed as a mechanism to induce or enhance the superconducting
state on fcc YH$_3$ and ScH$_3$. In particular, the evolution of their
structural, electronic, and lattice dynamical properties, as well as the
electron-phonon coupling and superconducting critical temperature ($T_c$) is
presented and discussed, as a function of the electron- and hole-doping content
as well as applied pressure. The study was performed within the density
functional perturbation theory, taking into account the effects of zero-point
energy through the quasi-harmonic approximation, while the doping was
implemented by means of the construction of the Sc$_{1-x}$M$_{x}$H$_{3}$
(M=Ca,Ti) and Y$_{1-x}$M$_{x}$H$_{3}$ (M=Sr,Zr) solid solutions modeled with
the virtual crystal approximation (VCA). We found that the ScH$_3$ and YH$_3$
hydrides shown a significant improvement of their electron-phonon coupling
properties under hole-doping (M=Ca,Sr) and at pressure values close to
dynamical instabilities. Instead, by electron-doping (M=Ti,Zr), the systems do
not improve such properties, whatever value of applied pressure is considered.
Then, as a result, $T_c$ rapidly increases as a function of $x$ on the
hole-doping region, reaching its maximum value of $92.7(67.9)$~K and
$84.5(60.2)$~K at $x=0.3$ for Sc$_{1-x}$Ca$_{x}$H$_{3}$ at $10.8$~GPa and
Y$_{1-x}$Sr$_{x}$H$_{3}$ at $5.8$~GPa respectively, with $\mu^{*}=0(0.15)$,
while for both, electron- and hole-doping, $T_c$ decreases as a function of the
applied pressure, mainly due to phonon hardening. By the thorough analysis of
the electron-phonon properties as a function of doping and pressure, we can
conclude that the tuning of the lattice dynamics is a promising path for
improving the superconductivity on both systems.
