The Sleep spell states:
This spell sends creatures into a magical slumber. Roll 5d8; the total is how many hit points of creatures this spell can affect.
The sleep spell doesn't deal damage directly, instead affecting a number of hit points (current hit points) and sending one or a number of creatures into magical slumber. Since this spell does not deal direct damage, I don't believe there are any attributes, spells, or effects that can counter the Sleep spell's effects, aside from the one caveat at the end of the spell description:
Undead and creatures immune to being charmed aren't affected by this spell.
This, however, simply immunizes the creature from the effects of the spell entirely. I'd like to find a trait, spell, or other effect that is RAW and that lessens but does not necessarily entirely nullify the effects of the Sleep spell and other spells that affect hit point totals (e.g. Color Spray).
My motivation? I have a homebrew race that I'm developing for my campaign, and one of its defining characteristics is resistance to anything and everything magical (broken, but it fits the story). I've already given it resistance to all types of magical damage (except for force damage; I've made a racial feat for that) and the trait Magic Resistance. Primarily I'm using members of this race as enemy NPCs. I understand that a race like this is beyond overpowered, but that is the topic for another discussion.
As of now, this race is not resistant to the effects of spells that affect hit point totals. I'd like to find a way to mitigate the effect this category of spell has on this race without making it entirely immune.
RAW answers only, please, if they exist.