Secret passage plugin

Apologies if this is necro-posting, but I'd like to get this working too. I'm also getting the "never goes invisible" on the demo project, but my F8 console log is clear - EXCEPT that the Network tab shows the same error messages in a different format yet they don't appear on the console. The 3 pixi files are where they're supposed to be in the demo's lib/js folder.

I know too little of Javascript to be sure, but a validator didn't like the ";" missing after "
Tilemap__paintTiles.call(this, startX, startY, x, y);
}
".
And after some digging in rpgcore.js and rpgobjects.js, and some crashes from trying this._regionId as a substitute, I can't figure out how the temp_mx and temp_my values are getting updated in the Tilemap__isHigherTile portion, as only tileID is being passed in.

Could we get a plugin guru to look at this, please? mykrme has been AWOL since January 10, maybe died in his sleep. ;L
Can a tile's region be changed mid-game?
It'd be nice to go behind a wall, and then later be walking on top of it.
I made some little adjusts, check if its working properly.
Spoiler: code
Code:
/*:
 * @plugindesc    The SecretPassage plugin allows you to make an otherwise impassable tile passable through the use of regions.
 * @author    mykrme
 *
 * @param    Passable
 * @desc    The region number used for a secret passage - always passable.
 * @default    1
 *
 * @param    Impassable
 * @desc    The region number used for the surroundings of a secret passage - always impassable.
 * @default    2
 *
 * @param    Invisible
 * @desc    The region number used for a secret passage - always passable. Character is invisible.
 * @default    3
 *
 * @help 
 */
var settings = PluginManager.parameters("SecretPassage");
var passable_region = parseInt(settings["Passable"]) || 1;
var impassable_region = parseInt(settings["Impassable"]) || 2;
var invisible_region = parseInt(settings["Invisible"]) || 3;

var _Game_Map_checkPassage = Game_Map.prototype.checkPassage;
Game_Map.prototype.checkPassage = function(x, y, bit) {
    var region = $gameMap.regionId(x, y);
    switch (region) {
        case passable_region:
        case invisible_region: return true;
        case impassable_region: return false;
        default: return _Game_Map_checkPassage.call(this, x, y, bit);
    }
};

var ShaderTilemap__paintTiles = ShaderTilemap.prototype._paintTiles;
ShaderTilemap.prototype._paintTiles = function(startX, startY, x, y) {
    this._temp_mx = startX + x;
    this._temp_my = startY + y;
    this._tileId_below = this._readMapData(this._temp_mx, this._temp_my + 1, 0); // only checks A type tiles
    ShaderTilemap__paintTiles.call(this, startX, startY, x, y);
}

var Tilemap__isHigherTile = Tilemap.prototype._isHigherTile;
Tilemap.prototype._isHigherTile = function(tileId) {
    var currentTile_invisibleRegion = this._readMapData(this._temp_mx, this._temp_my, 5) == invisible_region;
    var tileOneBelow_invisibleRegion = this._readMapData(this._temp_mx, this._temp_my + 1, 5) == invisible_region;
    var playerStandsBelow = $gamePlayer._realY > this._temp_my;
  
    if (!tileOneBelow_invisibleRegion && playerStandsBelow) { // to show the hat tops
        return Tilemap__isHigherTile.call(this, tileId);
    }
    if (currentTile_invisibleRegion) {
        return 0x10;
    }
    if (tileOneBelow_invisibleRegion && Tilemap.isSameKindTile(tileId, this._tileId_below)) { // to hide the hat tops
        return 0x10;
    }
    return Tilemap__isHigherTile.call(this, tileId);
};
Holy cow, it works now! Well done dude. I'm going to compare it to the original so that I can see what changes you made. Might help me learn a little JavaScript haha.

EDIT: Is there a way to add another region function? Say for region 4 that switches off the the passibility effect so the passage than can be walked on? i.e. a bridge. So you can walk below the bridge using region 3, then climb some stairs and hit a region 4 allowing you to walk on top of the bridge, then walk down a set of stairs on the other side, walking on top of a another region 4 that then allows you to go under the bridge again?
Hey @DragonVine, I'm glad it worked for you.

Sure it's possible, I'm kinda busy developing other stuff in my project in next weeks, but that would be a nice feature.

When it's done I'm gonna share in this post.
I've made passages plugin (supports also AUTOTILES). Allows player to be under/above the bridge/cliffs. Check it out here: https://forums.rpgmakerweb.com/index.php?threads/ocram-passages-plugin.88047/

Original thread: https://forums.rpgmakerweb.com/threads/secret-passage-plugin.73296/