Disabling collision damage with an enemy?

Recently I’ve been trying to make a ground slide attack that when the player slides into an enemy the collision damage that the player would normally receive would be disabled and the enemy would instead receive damage.

I already have something with the same basic concept using box trace by channel to allow the player to damage enemies by jumping on them Mario-style.

I thought I could modify the code to make it for the ground slide attack but unfortunately I haven’t had much luck in trying to get it to work.

Can anyone help me out in figuring out how I can make this concept work?

Thanks in advance!