One thing to be aware of with those functions - the strings returned are odd regarding cases.
If you try to do a match against the string values returned from magazines, its a nightmare. Somewhere along the way OFP changes the case of some of them, and they don't match what is defined in the units config.cpp
example: the config says the guy will have "mym4mag", "mym4mag"
But magazines will return "Mym4mag", "Mym4mag" on one guy, but on another guy it will return "MyM4mag", "MyM4mag"
so trying to do a
?_mag=="mym4mag":
turns into
?_mag=="mym4mag" || _mag=="MyM4mag" || _mag=="MyM4Mag"
etc....
I ran into this trying to make a very generalized swap out script for ammo - looking at each magazine and replacing it with something else...ended up aborting it because of the case issue. If OFP had some case functions (UCase, LCase, etc...) it would solve the issue, but alas no joy.