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.
Elf's Fey Ancestry is the closest I can think, but it is still immunity, not "resistance".
Aside from that, "Resistance" against sleep is something hard to define, to begin with. It is not a damaging spell, so the common "resistance" = half damage doesn't apply.
It also doesn't require an Attack Roll or a Saving Throw, so disadvantage/advantage (respectively) also doesn't apply.
Because of these reasons, I don't think there is any kind of feature that mitigates the sleep spell - every entry I know of is either immune to it or not.
Little Frame Challenge: You want it RAW, but you are yourself using it for a homebrew, so I fail to see the relevance of RAW.
A simple feature that is somehow "equivalent" to Resistance would say something on the lines of