Ive been trying to randomise abilites on PKHex, I can set the ability to either their first second or hidden ability by using .AbilityNumber=$0, .AbilityNumber=$1 and .AbilityNumber=$2 in the batch editor respectively. However I can't seem to get it to pick an ability number at random. I can randomise the IVs and nature by using similar functions but can't seem to get the ability number to randomise in the same way.
The functions I have tried are
.AbilityNumber=$0,$2
.AbilityNumber=$0,$1,$2
.AbilityNumber=$$0,$2
.AbilityNumber=$$0,$$2
Are any of these functions along the right lines is there something boneheadedly stupid I'm overlooking?
Any help is greatly appreciated.