I am working on an isometric game and I have a basic understanding of how A* pathfinding works and how we can pass in the effective “weight” for a tile to alter how favorable the said tile is.
However, I wanted to implement something where the “weight” is not constant but changes: (there could be many of other cases but)

The more the unit continues on a certain type of tile the “weight” gets lighter and more favorable.

Suppose there are 2 long strips of tiles one of type1 and other of type2 with type1 giving a weight of 2 for each tile while the tile of type2 has weight of 4 initially but decreases by 1 (down to a minimum of 1) for each type2 tile moved over in succession (but this “buff” gets reset if you move into some other type of tile)  shown in img below:

If the strip is even just 7 tiles long, moving along only the type2 tiles is technically shorter(13 weight as opposed to 14 weight of going along type1 tiles) but due to how the basic A* pathfinding method works the algorithm ends up giving the path only along type1 tiles.

Is it possible to somehow modify things so that this sort of functionality can be implemented without having to check “ALL” the possible paths.