How to add mention modules in dialog "Small Text" field

Hi All,

I would like to duplicate the mention feature on the comment section to my customize dialog in client script.

I found the in the comment.js, there are some codes below:

I wonder if I can duplicate this feature “Mention” my customize dialog field as well?

Like using the below example code:

So in my case, I would like to use mention @ in the field type of “Small text” or other text field.

Any suggestions would be great. Thank you in advance.