Wow!To this last bit ^: you were involved in x % of the encounter before being killed. That is the % you will be rewarded for.
You are building UP to 100%, not starting at 100% & falling.
It's a % system.
It involves some note taking, post session math, & DM judgment (I know, that's a heretical concept if you want a purely mechanical system/answer...)
It's based upon what % of the xp generating encounter you're character was involved in.
Charmed? Still involved, just playing for the other team.
Victim of some immobilizing spell/condition- subject to DM discretion.
Unconcious - just like being dead. But easier to cure....
Dead? We've established the dead don't gain xp (or lose it btw) So if for example you made it 40% through a fight (that the party succeeded at), you'd gain 40% of the expected xp. Unsuccessful encounters don't yield xp.
Player not at game? No xp. Because nobody but you runs your character. Since the character isn't being played, they don't do anything.
Next we have two different types of present but not active in the encounter:
Ex #1: Tonight Alex spent 9/16 rounds serving as the parties rear guard as we engaged in a (surprisingly tough & lengthy) encounter to clear the mouth of our escape rout. We knew we were being pusued. (Still are) So Alex waited in ambush until we sent the signal late into the 9th round to get his rear up the tunnel. The time he spent on guard duty turned out to be 9 rounds of down time for him.
But Alex gets full XP because he was doing his job in the encounter, making choices/checks, etc. He could have been actively stabbing things on the front line. Or he could be making sure we weren't set upon from behind. He couldn't do both at once.
Ex#2: in our 5e game the party decides to take a short rest. The Rogue though declares that he's going to scout/explore ahead instead.
The rest of the party refuses to go with him.
The rogue received all the xp for the several encounters he succefully dealt with. The party? No XP for those encounters - but they're rested!
None of my fellow Germans could have invented a more detailed system requiring more administrative work.

Just: Wow!