Show Heart Level on screen based on variables

Hello,my goal is to make an icon/picture show on screen/corner of dialogue box depending on a relationship level(variables) that the player has with an npc.
I have attached the example below from old harvest moon game.
So it goes like this:
Relationship level 1= Show blackheart icon
Relationship level 2=
Show purple heart,
And so on.
I've searched around and haven't found what I'm really looking for.
You can make a parallel event or common parallel event to be running all the time with a conditional branch:
if($gamemessage.isBusy()){
// calc the relationship level then show the picture of the heart according to it}else{erase or set the picture opacity to 0}

Or you can make a conditional branch before every dialogue checking the relationship and showing the picture.
Right. @Eliaquim's code is a very elegant way to do it because you won't need to copy (and perhaps change) your eventing into hundreds of different dialogues, but if you're a beginner, the best way to do it is to check the value of the variable before a piece of dialogue, use a Show Picture Command to display the correct heart picture (e.g. "If Ellie Relationship > 50, If Ellie Relationship < 75, Show Orange Heart, End, End"), and erase that picture after the dialogue. If you don't know how to use Variables and Conditional Branches at all, go ahead and find a tutorial to learn about them - @Andar has some good links in his signature, I think.

Finally, one other alternative is to use SumRndmDde's HUD Maker plugin, but I think this would probably be better used for something like a health bar made of hearts, rather than showing a single picture only while dialogue is being displayed. It would get the job done, but there are simpler ways to do it.
Thank you,your reply is very helpful. I have vision now how to make it. This is solved please close.

Original thread: https://forums.rpgmakerweb.com/threads/show-heart-level-on-screen-based-on-variables.120988/