Nondeterministic measurement-based cooling is remarkable in the average-population-reduction rate but suffers from a limited success probability of finding the target system in the ground state. In this work, we exploit the population-transfer mechanisms of both conditional and unconditional measurements and propose a two-step qubit-assisted protocol allowing to cool a resonator down to its ground state with a near-unit probability. In the first step, the unconditional measurements on the ancillary qubit are utilized to reshape the target resonator from a thermal state to a reserved Fock state. The measurement sequence is optimized by reinforcement learning for a maximum fidelity. In the second step, the population transfer between neighboring Fock states can be faithfully realized by the conditional measurements on the qubit. The population over the reserved state is then transferred in a step-by-step way toward the resonator's ground state with a near-unit fidelity. Intrinsic nondeterminacy of the projection-based manipulation is effectively inhibited by optimizing the measurement time-spacing. Through our protocol with dozens of measurements, the initial thermal average occupation can be reduced by five orders in magnitude with a success probability over 95%.