Erlang: code change (gen_fsm) without stopping the system

Could someone help me in this doubt?

From what I read in the erlang appup cookbook documentation I can’t replace the module (gen_XXX) and HOT SWAP the code.
I’m sketching a system, so I decided to make small test pieces and then start developing. How can I make a modification to mod4_fsm which is a behavior(gen-fsm) and replace mod4_fsm without rebooting the system? below I put the test design.

mod1.erl
|
V
Mod1_app
|
V
mod2_sup_sup
|
V
mod3_sup
|
V
Mod4_fsm

Mod1.appup

{“1.1.2”,
[{<<“1\…">>, [{restart_application, mod1}]}],
[{<<"1\…
”>>, [{restart_application, mod1}]}],

Mod1.app

{application, Mod1,
[{description, “My test”},
{vsn, “1.1.2”},
{modules,
[
mod1,
mod1_app,
mod2_sup_sup,
mod3_sup,
mod4_fsm]},
{registered, [mod1]},
{applications, [kernel, stdlib, sasl]},
{mod, {Mod1_app, []}}]}.