If the ragdoll entity is scripted and stores what player owns it, you can relay all damage on it to the player it belongs to. The ragdoll isn’t actually the player, it’s just a ragdoll of the same model. Depending on what addon you’re using and how it is doing the ragdolling, it might store the owner in a different way. You can look into Entity:GetRagdollOwner(), but you’ll probably wanna look at the code that does the ragdolling in the first place.
To relay the damage, simply catch any damage on the ragdoll with either a EntityTakeDamage hook or in the entity’s ENT:OnTakeDamage, then use Entity:TakeDamageInfo on the ragdoll owner with the same damage info as the hooks/functions gave.