How would i get something like this to work?

Sorry for the bad title, cant exactly figure out what i want done is called

but basically working on some gun talent system
(Like enchants on guns, 10% Chance for 1.2x Dmg, 20% Faster firerate ect)

But with multiple talents and stuff that is based on other stuff how would i get it to work (horrible explanation, idea below)

something like a talent that is based of damage, like heal 20% of the damage you deal
but i have another talent that increases / decreases damage from -20% to 20%, how would i get healing to work with that talent? as of right now i just do damage through modules with the entire talents function in them

Do you mean like making a chance system for getting your talent things

no all guns will roll random talents i got that, but what if i have a talent where i do 50% damage to chest, but i also want that extra 50% when activated to apliy to the healing talent that heals 20% of the damage i do

kinda like
Without extra Dmg / didnt hit torso
100 Damage
20 healed

With extra Dmg / hit torso
120 Dmg
24 healed

something like

Ok well you’ll need a way to know what talent they have currently. Then in your sword/tool damage script (if you use a touch event) check if hit.Name == “Torso” (if it’s R15 use HumanoidRootPart) if it is then multiply the normal damage by the extra amount

Yeah i got that part down, but im wondering how i would get the scaled damage from the talent which only the player hits sometimes and take that damage / whatever they do from that time and apply it to the healing talent to heal 20% of the damage dealt