This would have to be done with a NAS Lua script.
When alarm B came in you would have to check all alarms to see if alarm A existed then close it.
Depending on your environment and number of open alarms this could take some time.
As nas is asynchronous this could cause an issue with processing alarms.