It sounds really like 害矣 in Hokkien.
If you learn it literally,
害(hai) means something is really worse, you're in a big trouble, or whatever may cause you to be punished or do something you're unwilling to do.
矣(ah) means an action is done, something is finished or a sentence is ended.
In lots of situations, people may write 矣 as 啊 or 阿 because the way to pronounce 啊 and 阿 in Mandarin is "ah".
The reason I consider it a word from Hokkien is that Minnan, a region in Chinese Mainland, used to be very crowded. Half of it is hills or mountains, which is not good for planting rice. Thus, in the Ming and Qing dynasty, a bunch of people decided to leave there for Southeast Asia or Taiwan. They also spread this language to these places.
hai--ah, gua be ki ai sia gong koh ah!
Damn! I forgot to do my homework.
hai--ah hai--ah, hit tsang tsiu be to ah.
Oh no, the tree is falling down!