Resonantly-initiated quantum trajectories and their role in the generation of near-threshold harmonics