Request for information on how to edit variables!

Hi everyone ^^

My request is simple:
I would like to edit certain variables of one of my divisions as in the editor for NPCs

more precisely I would like to be able to set a variable according to the type of the ombjet that es represents

Like the NPCBehavio Script variable in the NPC editor

Is it possible?
If so, how could I go about it?

example :


Last little question!
Would it be possible to do the same thing in a table?

Thanks in advance for your answers! ^^