Example 4 (11th "Hope Cup" Invitational Competition Question) If the minimum value of the function $y=\cos ^{2} x-3 \cos x+a$ is $-\frac{3}{2}$, then the range of $a^{y}$ is ().
A. $\left[2^{-\frac{9}{2}}, 2^{\frac{3}{2}}\right]$
B. $\left[2^{-\frac{3}{2}}, 2^{\frac{9}{2}}\right]$
C. $\left[2^{-\frac{3}{2}}, 2\right]$
D. $\left[2,2^{\frac{9}{2}}\right]$
Solution: Choose A. Reason: Since $|\cos x| \leqslant 1$, we have $y=\cos ^{2} x-3 \cos x+a=\left(\cos x-\frac{3}{2}\right)^{2}+$ $\left(a-\frac{9}{4}\right) \geqslant\left(1-\frac{3}{2}\right)^{2}+\left(a-\frac{9}{4}\right)=a-2$. According to the problem, we have $a-2=-\frac{3}{2}$, which gives $a=\frac{1}{2}$, then $a^{y}=$ $\frac{9}{2}$, the minimum value is $\left(1-\frac{3}{2}\right)^{2}-\frac{7}{4}=-\frac{3}{2}$, and since $\left(\frac{1}{2}\right)^{x}$ is monotonically decreasing, we have $2^{-\frac{9}{2}} \leqslant a^{y} \leqslant 2^{\frac{3}{2}}$.