Probably identical to هَمّ (hamm, “concern”) from the root ه م م (h m m), with sound changes typical to Arabic, as e.g. in إن (ʔin). Note also the noun هَن (han, “thing; self, synonym of نَفْس (nafs)”), often mentioned in grammars as one of “the six nouns” also known as “five nouns“, which became obsolete due to often referring to genitalia.