Check if player can trigger an event?

So basically what I need is an "Action Indicator" "plugin"(common event, whatever) which would show a picture when I'm facing an interactable event.

I was looking inside GALV's "Action Indicator" plugin since it has a somewhat similar concept, but I don't know a thing about coding. Here are some random lines that might game me some solution, but I'm not sure. (can't post it all since it's not perfectly legal.

JavaScript:
// Game_Player

Galv.AI.checkActionIcon = function() {
    var x2 = $gameMap.roundXWithDirection($gamePlayer._x, $gamePlayer._direction);
    var y2 = $gameMap.roundYWithDirection($gamePlayer._y, $gamePlayer._direction);
    var action = null;
    
    
    // CHECK EVENT STANDING ON
    $gameMap.eventsXy($gamePlayer._x, $gamePlayer._y).forEach(function(event) {
        action = xxx
    });
    
    // CHECK EVENT IN FRONT
    if (!action) {
        $gameMap.eventsXy(x2, y2).forEach(function(event) {
            if (event.isNormalPriority()) {
                action = xxx
            };
        });
    };
    
    // CHECK COUNTER
    if (!action && $gameMap.isCounter(x2, y2)) {
        var direction = $gamePlayer.direction();
        var x3 = $gameMap.roundXWithDirection(x2, direction);
        var y3 = $gameMap.roundYWithDirection(y2, direction);
        $gameMap.eventsXy(x3, y3).forEach(function(event) {
            if (event.isNormalPriority()) {
                action = xxx
            };
        });
    };
    action = [S]xxx[/S]
    $gamePlayer.actionIconTarget = action;
};


};

Original thread: https://forums.rpgmakerweb.com/threads/check-if-player-can-trigger-an-event.128852/