MV Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.

I have strange error in my project, meaning, when the boss uses second time his primary skill wich is set like this https://prnt.sc/wkc0gk

Game crashes throwing following error
https://prnt.sc/wkbz6s (console log - https://prnt.sc/wkc10p)

This happens in test mode and after deployment... At first I thought it is because of Yanfly's Visual HP gauges so I turned it off, but still no luck... I don't think it's because of plugins order, because it all generaly works great, but... Anyway, here's my plugin list:

#1 - https://prnt.sc/wkc25z
#2 - https://prnt.sc/wkc32c * - see the spoiler
#3 - https://prnt.sc/wkc3jl
#4 - https://prnt.sc/wkc3wq
#5 - https://prnt.sc/wkc478

...Using MV 1.6.2
Now for the spoiler info:
Spoiler
SOL_CoreEngine.js is my plugin wich provides following add-ons for MV engine:
* Skips title screen
* Launches game in full screen
* Has custom, static exp table for all actor's classes
* Draws extended info about exp for actors (including percentage status)
* Changes max TP for main actors, so everyone has different values per level
* Completly disables function keys (except F8 and F12)
* Shows random image on loading scene (special thanks for @caethyril )
* Disables mouse input
* Adds Load command to window menu in game
* Enables coloring names for skills and items
* Displays custom victory message with loot results
* Changes critical damage values per level for main actors
* Has custom function to calculate percentage probability (not used in game yet)
* Recover All event also regenerates TP
* Allows to display integers like currency (instead of 1000 game displays 1.000)
* Changes max number of save files to 10
* Window_Choice wich is game choices now displays at position of currently running event
* Changes padding of face actor and message in message window
* Forces message window to display text on dimmed background
* Adds to save/load manager custom objects (special thanks for @caethyril )
* Allows to event fields "name" and "note" act like potential NPC name and job
* Items with scope "The user" are used without selecting actors
* Draws actor faces instead names in battle in window.

SOL_X_BattlerAlignment.js:
* Forces all battlers to have same positioning on screen (special thanks for @caethyril )

SOL_X_SkillDescriptions.js:
* Reads skills descriptions from text file

SOL_X_SkillListLayout.js:
* Changes how window_skillList, window_ItemList and window_Help are displayed in battle

SOL_X_SkillFormula.js:
* Stores all skill formulas in class

SOL_X_SkipPartyMenu:
* Disables menu in battle with options "Fight", "Escape"

SOL_X_GalvQuestControl.js:
* Aliases GALV's methods over controling quests in game

SOL_X_DateTime.js:
* Simply adds a time class to check current date, time and other date time related methods

SOL_X_EyeOfTruth.js:
* It's a skill to read info about enemies

SOL_X_WindowGold.js:
* Adds to window gold more info to display in game menu
That error comes up when a gauge attempts to update and one of its values is not a number (NaN). The most common reason for this to happen is that the damage formula for the skill dealing damage is not returning a number, so it attempts to subtract undefined or NaN from the current Hp of the target, and results in their current hp being not a number.

Your damage formula is a flat number, so it's not likely that that alone is causing the problem. You could have a state or a buff that is increasing damage (or reducing damage) by an incorrect value, that results in the damage from this skill not being a number anymore. Like something referencing the level of the user, and it doesn't work correctly because enemies don't have levels, for example.

However, since your yanfly plugin load order is all 100% out of whack, it's much more likely to be what is causing the problem. Arrange his plugins in the order they appear on his website. Loading them out of order can cause all kinds of weird interactions, and this is one of them.
You're partialy right, but, I found part of problem. It's skill scope - this error occurs when enemy (actor) is about to die from that skill and when the skill have scope "All Enemies". Then this error happens:
When skill is set to All Enemies
When skill deals more damage than targets current HP


Edit: OK - I fixed problem.
Thread closed

It'd be good if you could not cross out all your text, as it makes it hard to read. It's nice to leave things intact so people having similar issues in the future can see if your solution helps them.

Original thread: https://forums.rpgmakerweb.com/threads/failed-to-execute-createlineargradient-on-canvasrenderingcontext2d-the-provided-double-value-is-non-finite.132080/