I'm a Chinese citizen and have a Spain long stay study visa (type D, multi-entry) that's valid for 180 days. The visa expires in April, and I want to know if it is possible to immediately apply for a short term Schengen visa that's valid from May? I've heard that the 90 days per 180-day-period only applies to short stay visas, and the time spent in Spain under the type D long stay visa is not counted. Is that true?
Yes, it is. The relevant law/regulation is cited in my answer to Does tourist visa (90 days) apply after a long-term visa ends in Schengen countries? (that question was about someone who does not need a short-stay visa but the answer also applies to your situation).
Unfortunately, it's easier to benefit from that if you don't need a short-stay visa because you might need to go back to China or some other place where you have the right to reside and wait for the visa there. Worse, not having a stable job or life in China (if that's your case) would work against your application.
I don't think you can generally apply for a short-stay Spanish visa in Spain (or, actually, from any Schengen country as you typically need to prove you are a resident in the district covered by the consulate to which you apply and if you are already a resident in the Schengen area, you don't need a short-stay visa).
So the 90-day limit is not a problem but getting a visa might be, for unrelated reasons.