Script that allows transparency in sprites to change the color of tiles

Hello, I have a question. Is there anyway, through a script or anything, that I could have the transparency surrounding my event sprites could chance the color of the tiles it overlaps.

Basically, im making a game thats in the style of an old ms dos game
What would usually happen with those old computer games is that sprites would either have no transparency, meaning theres a black box around them, or there was transparency but the colors of the graphics around them would change colors.

Currently, my sprites have the black box since that was easier.
final1.PNG
final3.PNG


index.php


What I would like to do is instead of having the box, having the sprites without the box so the background is transparent but the background would change the color of the tiles.
I made a drawing to illustrate what I want
2.png


Is it at all possible to do this? Is there a script available that I can use to achieve this?
The problem is that I dont even know what to look up because this is such a specific.
Thank you very much for your time

Original thread: https://forums.rpgmakerweb.com/threads/script-that-allows-transparency-in-sprites-to-change-the-color-of-tiles.170208/