Armor Penetration system similar to Helldivers 2

Greetings!

As the title suggests, I am looking for help in creating an armor penetration system similar to the hit game “Helldivers 2”. So far, I am using a float variable that I can change the armor penetration value, and am planning on adding a way for an armor value varibale. If the armor pen is equal to the armor value, then the damage is reduced by 50% but if it is more, it deals 100% damage, and if it is less, then it does no damage (planning on making it ricochet, but it is not in the scope at the moment). I wanted to know if anyone knew a better way before I moved forward and tried to figure this out.

I haven’t been able to find much information on a system like this, so any help is much appreciated.