As I said, they're located in several places. It depends on each ability. For example Blaze, Torrent, Swarm etc. are all located in the damage calc routines, whereas abilities like Stench are located in several different calls to do with the overworld.
Hex is literally just a way of reading the data. The scripts and ASM routines are just bytes that are interpreted.
Moves for example are structured in a table, and are then read. Abilities are just a series of checks that exist in routines. To make new abilities, you need to know where a similar, existing ability is located, and branch from there to add a new check.
I've created an ability resource thread to give you an idea of how to go about doing that. I haven't updated it in a while because most of the ones I have left are contained in giant routines.