The quantized version of the anomalous Hall effect realized in magnetic topological insulators (MTIs) has great potential for the development of topological quantum physics and low-power electronic/spintronic applications. Here we report the thickness-tailored quantum anomalous Hall (QAH) effect in Cr-doped (Bi,Sb)2Te3 thin films by tuning the system across the two-dimensional (2D) limit. In addition to the Chern number-related QAH phase transition, we also demonstrate that the induced hybridization gap plays an indispensable role in determining the ground magnetic state of the MTIs; namely, the spontaneous magnetization owing to considerable Van Vleck spin susceptibility guarantees the zero-field QAH state with unitary scaling law in thick samples, while the quantization of the Hall conductance can only be achieved with the assistance of external magnetic fields in ultrathin films. The modulation of topology and magnetism through structural engineering may provide useful guidance for the pursuit of other QAH-based phase diagrams and functionalities.