You could make 3 bars for each statistic... one white (for the current weapon) and one red and one green.
You would then need to store the stats for the weapon you're comparing with in a set of variables (global or local would probably do) then do some comparisons.
The white bar would always be shown on top, with the red or green being underneath - visibility of each bar based on the comparisons;
Example pseudo code:
Compare -> WeaponVariable.RateofFire is less than Weapon2Variable.RateofFire -> GreenBar = invisisble, RedBar = visible
Every tick -> Set WhiteBar.value to WeaponVariable.RateofFire
Every tick -> Set RedBar.Value to Weapon2Variable.RateofFire
There's always a million ways to do stuff, but this should work